結果

問題 No.479 頂点は要らない
ユーザー 👑 rin204rin204
提出日時 2022-07-10 16:23:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 247 ms / 1,500 ms
コード長 409 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 86,912 KB
実行使用メモリ 92,452 KB
最終ジャッジ日時 2023-09-01 23:17:32
合計ジャッジ時間 8,766 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,184 KB
testcase_01 AC 71 ms
71,296 KB
testcase_02 AC 73 ms
71,084 KB
testcase_03 AC 71 ms
71,088 KB
testcase_04 AC 70 ms
71,464 KB
testcase_05 AC 70 ms
71,244 KB
testcase_06 AC 70 ms
71,360 KB
testcase_07 AC 71 ms
71,440 KB
testcase_08 AC 72 ms
70,932 KB
testcase_09 AC 70 ms
71,088 KB
testcase_10 AC 70 ms
71,264 KB
testcase_11 AC 69 ms
71,196 KB
testcase_12 AC 70 ms
71,088 KB
testcase_13 AC 73 ms
71,360 KB
testcase_14 AC 72 ms
71,404 KB
testcase_15 AC 70 ms
71,236 KB
testcase_16 AC 71 ms
71,092 KB
testcase_17 AC 71 ms
71,140 KB
testcase_18 AC 73 ms
71,192 KB
testcase_19 AC 102 ms
75,984 KB
testcase_20 AC 93 ms
75,892 KB
testcase_21 AC 86 ms
75,372 KB
testcase_22 AC 91 ms
75,768 KB
testcase_23 AC 91 ms
75,392 KB
testcase_24 AC 88 ms
75,492 KB
testcase_25 AC 91 ms
75,764 KB
testcase_26 AC 247 ms
89,228 KB
testcase_27 AC 242 ms
89,140 KB
testcase_28 AC 183 ms
92,452 KB
testcase_29 AC 206 ms
83,812 KB
testcase_30 AC 207 ms
84,144 KB
testcase_31 AC 187 ms
83,656 KB
testcase_32 AC 188 ms
83,640 KB
testcase_33 AC 219 ms
84,128 KB
testcase_34 AC 208 ms
84,520 KB
testcase_35 AC 202 ms
81,636 KB
testcase_36 AC 172 ms
79,248 KB
testcase_37 AC 229 ms
85,260 KB
testcase_38 AC 208 ms
83,308 KB
testcase_39 AC 189 ms
83,144 KB
testcase_40 AC 192 ms
84,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
edges = [[] for _ in range(n)]
for _ in range(m):
    u, v = map(int, input().split())
    edges[u].append(v)
used = [False] * n
one = False
for i in range(n - 1, -1, -1):
    for v in edges[i]:
        if not used[v]:
            used[i] = True
            break
    if used[i]:
        print("1", end="")
        one = True
    elif one:
        print("0", end="")
print()

0