結果

問題 No.479 頂点は要らない
ユーザー maspymaspy
提出日時 2020-03-03 10:02:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 242 ms / 1,500 ms
コード長 556 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 34,008 KB
最終ジャッジ日時 2024-04-21 23:22:38
合計ジャッジ時間 5,237 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,624 KB
testcase_01 AC 36 ms
10,624 KB
testcase_02 AC 41 ms
10,880 KB
testcase_03 AC 33 ms
10,496 KB
testcase_04 AC 35 ms
10,752 KB
testcase_05 AC 31 ms
10,624 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 32 ms
10,752 KB
testcase_08 AC 32 ms
10,496 KB
testcase_09 AC 33 ms
10,624 KB
testcase_10 AC 33 ms
10,624 KB
testcase_11 AC 32 ms
10,752 KB
testcase_12 AC 32 ms
10,496 KB
testcase_13 AC 31 ms
10,496 KB
testcase_14 AC 32 ms
10,624 KB
testcase_15 AC 32 ms
10,624 KB
testcase_16 AC 34 ms
10,752 KB
testcase_17 AC 31 ms
10,752 KB
testcase_18 AC 32 ms
10,752 KB
testcase_19 AC 34 ms
10,752 KB
testcase_20 AC 33 ms
10,752 KB
testcase_21 AC 32 ms
10,624 KB
testcase_22 AC 32 ms
10,752 KB
testcase_23 AC 33 ms
10,880 KB
testcase_24 AC 33 ms
10,752 KB
testcase_25 AC 34 ms
10,752 KB
testcase_26 AC 242 ms
34,008 KB
testcase_27 AC 242 ms
34,008 KB
testcase_28 AC 184 ms
32,600 KB
testcase_29 AC 162 ms
30,168 KB
testcase_30 AC 159 ms
30,168 KB
testcase_31 AC 154 ms
30,296 KB
testcase_32 AC 159 ms
30,296 KB
testcase_33 AC 175 ms
28,256 KB
testcase_34 AC 199 ms
29,272 KB
testcase_35 AC 162 ms
27,656 KB
testcase_36 AC 104 ms
20,380 KB
testcase_37 AC 184 ms
29,336 KB
testcase_38 AC 164 ms
26,376 KB
testcase_39 AC 128 ms
21,900 KB
testcase_40 AC 152 ms
24,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


# %%
N, M = map(int, readline().split())
m = map(int, read().split())
AB = zip(m, m)

# %%
G = [[] for _ in range(N)]
for a, b in AB:
    if a > b:
        a, b = b, a
    G[b].append(a)


# %%
buy = [False] * N
for n in range(N - 1, -1, -1):
    if buy[n]:
        continue
    for v in G[n]:
        buy[v] = True

# %%
while not buy[-1]:
    buy.pop()
print(''.join('1' if bl else '0' for bl in buy[::-1]))
0