結果

問題 No.479 頂点は要らない
ユーザー nanaenanae
提出日時 2017-01-27 23:58:48
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 725 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 114,720 KB
最終ジャッジ日時 2023-08-25 11:11:57
合計ジャッジ時間 6,217 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
75,816 KB
testcase_01 AC 72 ms
71,376 KB
testcase_02 AC 70 ms
71,248 KB
testcase_03 AC 73 ms
71,388 KB
testcase_04 AC 72 ms
71,376 KB
testcase_05 AC 72 ms
71,448 KB
testcase_06 AC 72 ms
71,248 KB
testcase_07 AC 73 ms
71,760 KB
testcase_08 AC 71 ms
71,440 KB
testcase_09 AC 71 ms
71,048 KB
testcase_10 AC 70 ms
71,476 KB
testcase_11 AC 72 ms
71,080 KB
testcase_12 AC 71 ms
71,248 KB
testcase_13 AC 72 ms
71,340 KB
testcase_14 AC 70 ms
71,280 KB
testcase_15 AC 72 ms
71,420 KB
testcase_16 AC 71 ms
71,052 KB
testcase_17 AC 71 ms
71,248 KB
testcase_18 AC 71 ms
71,296 KB
testcase_19 AC 104 ms
75,948 KB
testcase_20 AC 87 ms
75,964 KB
testcase_21 AC 87 ms
75,316 KB
testcase_22 AC 90 ms
75,792 KB
testcase_23 AC 90 ms
75,852 KB
testcase_24 AC 91 ms
76,240 KB
testcase_25 AC 87 ms
75,516 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, input().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, input().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