結果

問題 No.479 頂点は要らない
ユーザー roarisroaris
提出日時 2020-07-26 20:42:38
言語 PyPy3
(7.3.15)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 423 bytes
コンパイル時間 744 ms
コンパイル使用メモリ 86,692 KB
実行使用メモリ 111,944 KB
最終ジャッジ日時 2023-09-11 04:57:25
合計ジャッジ時間 9,979 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,108 KB
testcase_01 AC 75 ms
70,888 KB
testcase_02 AC 76 ms
71,372 KB
testcase_03 AC 76 ms
71,296 KB
testcase_04 AC 76 ms
71,376 KB
testcase_05 AC 76 ms
71,152 KB
testcase_06 AC 75 ms
71,120 KB
testcase_07 AC 76 ms
71,176 KB
testcase_08 AC 75 ms
71,376 KB
testcase_09 AC 74 ms
71,212 KB
testcase_10 AC 75 ms
71,260 KB
testcase_11 AC 77 ms
71,312 KB
testcase_12 AC 77 ms
70,888 KB
testcase_13 AC 74 ms
71,380 KB
testcase_14 AC 76 ms
71,380 KB
testcase_15 AC 76 ms
71,420 KB
testcase_16 AC 76 ms
71,372 KB
testcase_17 AC 75 ms
71,312 KB
testcase_18 AC 76 ms
70,888 KB
testcase_19 AC 83 ms
75,748 KB
testcase_20 AC 80 ms
71,164 KB
testcase_21 AC 83 ms
75,888 KB
testcase_22 AC 83 ms
75,744 KB
testcase_23 AC 83 ms
75,816 KB
testcase_24 AC 81 ms
75,608 KB
testcase_25 AC 78 ms
71,356 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

n, m = map(int, input().split())
G = [[] for _ in range(n)]

for _ in range(m):
    a, b = map(int, input().split())
    G[a].append(b)
    G[b].append(a)

s = set()
ans = []

for v in range(n-1, -1, -1):
    for nv in G[v]:
        if nv>v and nv not in s:
            s.add(v)
            ans.append('1')
            break
    else:
        ans.append('0')

print(int(''.join(ans)))
0