結果

問題 No.479 頂点は要らない
ユーザー nanaenanae
提出日時 2017-01-27 23:57:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 725 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 54,076 KB
最終ジャッジ日時 2023-08-25 11:10:42
合計ジャッジ時間 4,544 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
15,084 KB
testcase_01 AC 17 ms
7,984 KB
testcase_02 AC 17 ms
8,152 KB
testcase_03 AC 16 ms
7,972 KB
testcase_04 AC 16 ms
8,068 KB
testcase_05 AC 16 ms
8,020 KB
testcase_06 AC 16 ms
8,024 KB
testcase_07 AC 17 ms
8,092 KB
testcase_08 AC 16 ms
8,044 KB
testcase_09 AC 16 ms
7,972 KB
testcase_10 AC 17 ms
8,156 KB
testcase_11 AC 16 ms
8,016 KB
testcase_12 AC 16 ms
8,016 KB
testcase_13 AC 16 ms
8,120 KB
testcase_14 AC 16 ms
8,016 KB
testcase_15 AC 16 ms
8,128 KB
testcase_16 AC 16 ms
8,128 KB
testcase_17 AC 16 ms
8,012 KB
testcase_18 AC 16 ms
8,060 KB
testcase_19 AC 29 ms
8,604 KB
testcase_20 AC 20 ms
8,544 KB
testcase_21 AC 19 ms
8,512 KB
testcase_22 AC 28 ms
8,588 KB
testcase_23 AC 32 ms
8,580 KB
testcase_24 AC 34 ms
8,916 KB
testcase_25 AC 28 ms
8,652 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