結果

問題 No.479 頂点は要らない
ユーザー ckawatakckawatak
提出日時 2019-03-25 23:42:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 221 ms / 1,500 ms
コード長 447 bytes
コンパイル時間 685 ms
コンパイル使用メモリ 82,232 KB
実行使用メモリ 90,272 KB
最終ジャッジ日時 2024-04-18 02:07:44
合計ジャッジ時間 6,392 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
51,840 KB
testcase_01 AC 43 ms
51,968 KB
testcase_02 AC 39 ms
51,840 KB
testcase_03 AC 43 ms
51,968 KB
testcase_04 AC 38 ms
51,840 KB
testcase_05 AC 39 ms
52,096 KB
testcase_06 AC 39 ms
52,480 KB
testcase_07 AC 39 ms
51,712 KB
testcase_08 AC 39 ms
51,712 KB
testcase_09 AC 38 ms
51,968 KB
testcase_10 AC 41 ms
52,096 KB
testcase_11 AC 39 ms
51,712 KB
testcase_12 AC 39 ms
51,884 KB
testcase_13 AC 39 ms
52,096 KB
testcase_14 AC 38 ms
52,480 KB
testcase_15 AC 40 ms
52,224 KB
testcase_16 AC 39 ms
52,352 KB
testcase_17 AC 39 ms
52,096 KB
testcase_18 AC 39 ms
51,712 KB
testcase_19 AC 64 ms
67,456 KB
testcase_20 AC 64 ms
67,072 KB
testcase_21 AC 55 ms
63,488 KB
testcase_22 AC 65 ms
66,816 KB
testcase_23 AC 62 ms
65,152 KB
testcase_24 AC 58 ms
64,384 KB
testcase_25 AC 64 ms
66,048 KB
testcase_26 AC 218 ms
87,680 KB
testcase_27 AC 221 ms
87,752 KB
testcase_28 AC 183 ms
90,272 KB
testcase_29 AC 184 ms
83,128 KB
testcase_30 AC 177 ms
82,560 KB
testcase_31 AC 187 ms
82,856 KB
testcase_32 AC 182 ms
82,944 KB
testcase_33 AC 195 ms
83,144 KB
testcase_34 AC 208 ms
83,284 KB
testcase_35 AC 197 ms
80,172 KB
testcase_36 AC 147 ms
78,080 KB
testcase_37 AC 198 ms
83,640 KB
testcase_38 AC 184 ms
81,920 KB
testcase_39 AC 161 ms
81,436 KB
testcase_40 AC 170 ms
83,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = list(map(int, input().split(' ')))
G = [[] for _ in range(N)]
keep = [0 for _ in range(N)]

for m in range(M):
    a,b = list(map(int, input().split(' ')))
    G[min(a,b)].append(max(a,b))
        
for n in reversed(range(N)):
    for c in G[n]:
        if keep[c] == 0:
            keep[n] = 1

first = 1
for i in reversed(range(N)):
    if keep[i] == 0 and first == 1:
        continue
    first = 0
    print(keep[i], end='')
print()    
0