提出 #829451
ソースコード 拡げる
N, M = map(int, input().split()) move = [] for i in range(M): move.append(list(map(int,input().split()))) box = [1 for i in range(N)] box_flag = [False for i in range(N)] box_flag[0] = True for i in range(len(move)): box[move[i][0]-1] -= 1 box[move[i][1]-1] += 1 if box_flag[move[i][0]-1]: box_flag[move[i][1]-1] = True if box[move[i][0]-1] == 0: box_flag[move[i][0]-1] = False print(box_flag.count(True))
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Box and Ball |
| ユーザ | syaga |
| 言語 | Python (3.4.3) |
| 得点 | 400 |
| コード長 | 428 Byte |
| 結果 | AC |
| 実行時間 | 921 ms |
| メモリ | 29128 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 400 / 400 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 0_00.txt, 0_01.txt, 0_02.txt |
| All | 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt, 1_22.txt, 1_23.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 0_00.txt | AC | 42 ms | 3064 KiB |
| 0_01.txt | AC | 42 ms | 3064 KiB |
| 0_02.txt | AC | 49 ms | 3064 KiB |
| 1_00.txt | AC | 47 ms | 3064 KiB |
| 1_01.txt | AC | 41 ms | 3064 KiB |
| 1_02.txt | AC | 46 ms | 3064 KiB |
| 1_03.txt | AC | 48 ms | 3064 KiB |
| 1_04.txt | AC | 858 ms | 25892 KiB |
| 1_05.txt | AC | 921 ms | 29128 KiB |
| 1_06.txt | AC | 890 ms | 25156 KiB |
| 1_07.txt | AC | 902 ms | 28236 KiB |
| 1_08.txt | AC | 571 ms | 18796 KiB |
| 1_09.txt | AC | 618 ms | 19820 KiB |
| 1_10.txt | AC | 201 ms | 8472 KiB |
| 1_11.txt | AC | 358 ms | 12336 KiB |
| 1_12.txt | AC | 81 ms | 5164 KiB |
| 1_13.txt | AC | 772 ms | 24072 KiB |
| 1_14.txt | AC | 422 ms | 14236 KiB |
| 1_15.txt | AC | 701 ms | 22356 KiB |
| 1_16.txt | AC | 61 ms | 4376 KiB |
| 1_17.txt | AC | 917 ms | 28036 KiB |
| 1_18.txt | AC | 816 ms | 25224 KiB |
| 1_19.txt | AC | 898 ms | 27384 KiB |
| 1_20.txt | AC | 856 ms | 25908 KiB |
| 1_21.txt | AC | 697 ms | 22336 KiB |
| 1_22.txt | AC | 899 ms | 27912 KiB |
| 1_23.txt | AC | 262 ms | 10204 KiB |