結果

問題 No.479 頂点は要らない
ユーザー rpy3cpprpy3cpp
提出日時 2017-01-30 01:40:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 357 ms / 1,500 ms
コード長 516 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 29,384 KB
最終ジャッジ日時 2023-08-25 15:12:03
合計ジャッジ時間 6,648 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,840 KB
testcase_01 AC 16 ms
7,756 KB
testcase_02 AC 16 ms
7,792 KB
testcase_03 AC 16 ms
7,808 KB
testcase_04 AC 16 ms
7,840 KB
testcase_05 AC 16 ms
7,816 KB
testcase_06 AC 16 ms
7,852 KB
testcase_07 AC 16 ms
7,816 KB
testcase_08 AC 16 ms
7,900 KB
testcase_09 AC 16 ms
7,764 KB
testcase_10 AC 17 ms
7,796 KB
testcase_11 AC 16 ms
7,772 KB
testcase_12 AC 16 ms
7,904 KB
testcase_13 AC 16 ms
7,992 KB
testcase_14 AC 17 ms
7,876 KB
testcase_15 AC 18 ms
7,956 KB
testcase_16 AC 17 ms
7,796 KB
testcase_17 AC 16 ms
7,856 KB
testcase_18 AC 17 ms
7,848 KB
testcase_19 AC 19 ms
8,240 KB
testcase_20 AC 19 ms
8,284 KB
testcase_21 AC 19 ms
7,848 KB
testcase_22 AC 19 ms
8,228 KB
testcase_23 AC 20 ms
8,348 KB
testcase_24 AC 19 ms
8,292 KB
testcase_25 AC 19 ms
8,328 KB
testcase_26 AC 357 ms
28,288 KB
testcase_27 AC 356 ms
28,240 KB
testcase_28 AC 307 ms
29,384 KB
testcase_29 AC 273 ms
20,104 KB
testcase_30 AC 276 ms
20,004 KB
testcase_31 AC 283 ms
20,048 KB
testcase_32 AC 279 ms
20,144 KB
testcase_33 AC 264 ms
20,212 KB
testcase_34 AC 312 ms
20,452 KB
testcase_35 AC 279 ms
15,332 KB
testcase_36 AC 177 ms
11,424 KB
testcase_37 AC 282 ms
21,528 KB
testcase_38 AC 242 ms
18,472 KB
testcase_39 AC 180 ms
17,296 KB
testcase_40 AC 212 ms
20,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def read_data():
    n, m = map(int, input().split())
    Es = [[] for v in range(n)]
    for _ in range(m):
        a, b = map(int, input().split())
        Es[a].append(b)
    return n, m, Es

def solve(n, m, Es):
    used = [0] * n
    for v in range(n - 1, -1, -1):
        for u in Es[v]:
            if not used[u]:
                used[v] = 1
                break
    while not used[-1]:
        used.pop()
    used.reverse()
    return ''.join(map(str, used))

n, m, Es = read_data()
print(solve(n, m, Es))
0