結果

問題 No.479 頂点は要らない
ユーザー nanaenanae
提出日時 2017-01-28 00:04:47
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 751 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 87,340 KB
実行使用メモリ 109,076 KB
最終ジャッジ日時 2023-08-25 11:12:35
合計ジャッジ時間 6,253 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
78,532 KB
testcase_01 AC 71 ms
71,380 KB
testcase_02 AC 66 ms
71,504 KB
testcase_03 AC 67 ms
71,300 KB
testcase_04 AC 68 ms
71,384 KB
testcase_05 AC 67 ms
71,160 KB
testcase_06 AC 68 ms
71,712 KB
testcase_07 AC 68 ms
71,144 KB
testcase_08 AC 68 ms
71,136 KB
testcase_09 AC 68 ms
71,380 KB
testcase_10 AC 67 ms
71,656 KB
testcase_11 AC 67 ms
71,372 KB
testcase_12 AC 68 ms
71,564 KB
testcase_13 AC 66 ms
71,396 KB
testcase_14 AC 69 ms
71,716 KB
testcase_15 AC 68 ms
71,304 KB
testcase_16 AC 68 ms
71,752 KB
testcase_17 AC 69 ms
71,328 KB
testcase_18 AC 69 ms
71,412 KB
testcase_19 AC 78 ms
75,356 KB
testcase_20 AC 74 ms
75,348 KB
testcase_21 AC 74 ms
71,124 KB
testcase_22 AC 77 ms
75,356 KB
testcase_23 AC 78 ms
75,432 KB
testcase_24 AC 81 ms
75,384 KB
testcase_25 AC 75 ms
75,188 KB
testcase_26 TLE -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG: {} -> {}'.format(name, val), file=sys.stderr)
            return None

n, m = map(int, sys.stdin.readline().split())
edges = {i:set() for i in range(n)}
buy = ['0'] * n
processed = list(range(0, n))

for i in range(m):
    a, b = map(int, sys.stdin.readline().split())
    edges[a].add(b)
    edges[b].add(a)

# debug(edges, locals())

while 1:
    max_v = max(processed)

    if max_v == -1:
        break

    processed[max_v] = -1

    for node in edges[max_v]:
        buy[node] = '1'
        processed[node] = -1

# debug(buy, locals())

ans = ''.join([str(b) for b in reversed(buy)])
ans = ans.lstrip('0')

print(ans)
0