結果

問題 No.479 頂点は要らない
ユーザー fiordfiord
提出日時 2017-07-19 13:59:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 1,500 ms
コード長 509 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 91,968 KB
最終ジャッジ日時 2024-04-17 04:00:22
合計ジャッジ時間 4,802 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
52,468 KB
testcase_01 AC 31 ms
52,944 KB
testcase_02 AC 34 ms
52,968 KB
testcase_03 AC 33 ms
52,408 KB
testcase_04 AC 30 ms
52,352 KB
testcase_05 AC 30 ms
53,372 KB
testcase_06 AC 31 ms
52,208 KB
testcase_07 AC 30 ms
52,064 KB
testcase_08 AC 32 ms
52,344 KB
testcase_09 AC 32 ms
52,528 KB
testcase_10 AC 32 ms
52,236 KB
testcase_11 AC 33 ms
53,260 KB
testcase_12 AC 32 ms
53,148 KB
testcase_13 AC 32 ms
52,140 KB
testcase_14 AC 33 ms
52,136 KB
testcase_15 AC 32 ms
53,088 KB
testcase_16 AC 33 ms
52,828 KB
testcase_17 AC 32 ms
52,440 KB
testcase_18 AC 32 ms
52,272 KB
testcase_19 AC 52 ms
65,256 KB
testcase_20 AC 50 ms
65,000 KB
testcase_21 AC 44 ms
62,528 KB
testcase_22 AC 49 ms
65,080 KB
testcase_23 AC 47 ms
64,320 KB
testcase_24 AC 45 ms
63,288 KB
testcase_25 AC 44 ms
62,936 KB
testcase_26 AC 162 ms
89,152 KB
testcase_27 AC 163 ms
88,788 KB
testcase_28 AC 133 ms
91,968 KB
testcase_29 AC 122 ms
83,656 KB
testcase_30 AC 121 ms
83,128 KB
testcase_31 AC 120 ms
83,400 KB
testcase_32 AC 121 ms
83,172 KB
testcase_33 AC 136 ms
83,548 KB
testcase_34 AC 142 ms
83,588 KB
testcase_35 AC 135 ms
81,700 KB
testcase_36 AC 100 ms
77,888 KB
testcase_37 AC 142 ms
84,740 KB
testcase_38 AC 123 ms
82,732 KB
testcase_39 AC 110 ms
82,152 KB
testcase_40 AC 136 ms
84,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
edge = [[] for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    edge[a].append(b)
    edge[b].append(a)
used = [True] * n
for i in reversed(range(n)):
    flag = False
    for e in edge[i]:
        if not used[e]:
            flag = True
    if not flag:
        used[i] = False
ret = ''.join(["1" if used[i] else "0" for i in reversed(range(n))])
s = 0
while s < len(ret) and ret[s] == "0":
    s += 1
ret = ret[s:]
print("0" if ret == "" else ret)
0