結果

問題 No.479 頂点は要らない
ユーザー titiatitia
提出日時 2023-06-06 04:11:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 397 ms / 1,500 ms
コード長 333 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 10,960 KB
実行使用メモリ 26,380 KB
最終ジャッジ日時 2023-08-28 10:14:35
合計ジャッジ時間 7,575 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,772 KB
testcase_01 AC 15 ms
7,904 KB
testcase_02 AC 16 ms
7,792 KB
testcase_03 AC 15 ms
7,748 KB
testcase_04 AC 15 ms
7,796 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 15 ms
7,712 KB
testcase_07 AC 15 ms
7,748 KB
testcase_08 AC 15 ms
7,868 KB
testcase_09 AC 15 ms
7,816 KB
testcase_10 AC 15 ms
7,876 KB
testcase_11 AC 15 ms
7,776 KB
testcase_12 AC 16 ms
7,776 KB
testcase_13 AC 15 ms
7,752 KB
testcase_14 AC 15 ms
7,800 KB
testcase_15 AC 15 ms
7,796 KB
testcase_16 AC 15 ms
7,780 KB
testcase_17 AC 15 ms
7,860 KB
testcase_18 AC 15 ms
7,752 KB
testcase_19 AC 18 ms
8,136 KB
testcase_20 AC 18 ms
8,240 KB
testcase_21 AC 18 ms
7,844 KB
testcase_22 AC 18 ms
8,236 KB
testcase_23 AC 19 ms
8,160 KB
testcase_24 AC 19 ms
8,248 KB
testcase_25 AC 18 ms
8,200 KB
testcase_26 AC 392 ms
25,600 KB
testcase_27 AC 397 ms
25,488 KB
testcase_28 AC 328 ms
26,380 KB
testcase_29 AC 313 ms
20,532 KB
testcase_30 AC 312 ms
20,484 KB
testcase_31 AC 310 ms
20,532 KB
testcase_32 AC 312 ms
20,568 KB
testcase_33 AC 322 ms
19,592 KB
testcase_34 AC 349 ms
19,968 KB
testcase_35 AC 330 ms
17,828 KB
testcase_36 AC 199 ms
14,008 KB
testcase_37 AC 338 ms
20,352 KB
testcase_38 AC 289 ms
18,228 KB
testcase_39 AC 207 ms
16,208 KB
testcase_40 AC 248 ms
18,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

ANS=["0"]*n

for i in range(n-1,-1,-1):
    if ANS[i]=="1":
        continue

    for to in E[i]:
        ANS[to]="1"

while ANS[-1]=="0":
    ANS.pop()
ANS.reverse()
print("".join(ANS))
0