結果

問題 No.1340 おーじ君をさがせ
ユーザー gorugo30gorugo30
提出日時 2021-01-15 22:24:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 550 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 87,120 KB
最終ジャッジ日時 2023-08-18 16:38:31
合計ジャッジ時間 12,106 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,000 KB
testcase_01 AC 71 ms
70,904 KB
testcase_02 AC 71 ms
71,260 KB
testcase_03 AC 72 ms
71,280 KB
testcase_04 AC 72 ms
71,192 KB
testcase_05 AC 71 ms
71,280 KB
testcase_06 AC 71 ms
71,376 KB
testcase_07 AC 72 ms
71,328 KB
testcase_08 AC 69 ms
71,108 KB
testcase_09 AC 69 ms
71,308 KB
testcase_10 AC 80 ms
76,084 KB
testcase_11 AC 84 ms
76,252 KB
testcase_12 AC 91 ms
76,372 KB
testcase_13 AC 78 ms
75,912 KB
testcase_14 AC 86 ms
76,392 KB
testcase_15 AC 76 ms
76,000 KB
testcase_16 AC 87 ms
76,436 KB
testcase_17 AC 76 ms
75,796 KB
testcase_18 AC 76 ms
75,804 KB
testcase_19 AC 77 ms
75,732 KB
testcase_20 AC 79 ms
76,356 KB
testcase_21 AC 196 ms
77,568 KB
testcase_22 AC 333 ms
77,656 KB
testcase_23 AC 190 ms
77,664 KB
testcase_24 AC 544 ms
78,860 KB
testcase_25 AC 113 ms
77,356 KB
testcase_26 AC 108 ms
77,728 KB
testcase_27 AC 108 ms
77,852 KB
testcase_28 AC 120 ms
77,264 KB
testcase_29 AC 103 ms
76,888 KB
testcase_30 AC 203 ms
77,692 KB
testcase_31 AC 550 ms
77,928 KB
testcase_32 AC 106 ms
77,628 KB
testcase_33 AC 115 ms
77,836 KB
testcase_34 AC 157 ms
77,800 KB
testcase_35 AC 161 ms
77,864 KB
testcase_36 AC 72 ms
71,192 KB
testcase_37 AC 99 ms
76,832 KB
testcase_38 AC 105 ms
77,528 KB
testcase_39 AC 434 ms
77,596 KB
testcase_40 AC 428 ms
77,592 KB
testcase_41 AC 429 ms
77,620 KB
testcase_42 AC 71 ms
71,324 KB
testcase_43 AC 71 ms
71,348 KB
testcase_44 AC 70 ms
71,328 KB
testcase_45 AC 72 ms
71,092 KB
testcase_46 AC 316 ms
78,520 KB
testcase_47 AC 319 ms
78,328 KB
testcase_48 AC 319 ms
78,528 KB
testcase_49 AC 434 ms
86,928 KB
testcase_50 AC 433 ms
86,680 KB
testcase_51 AC 435 ms
87,120 KB
testcase_52 AC 84 ms
76,196 KB
testcase_53 AC 82 ms
76,032 KB
testcase_54 AC 81 ms
76,316 KB
testcase_55 AC 177 ms
79,428 KB
testcase_56 AC 71 ms
71,184 KB
testcase_57 AC 70 ms
71,208 KB
testcase_58 AC 71 ms
71,200 KB
testcase_59 AC 79 ms
76,124 KB
testcase_60 AC 72 ms
71,140 KB
testcase_61 AC 83 ms
76,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, T = map(int, input().split())

goto = [[set() for j in range(N)] for i in range(60)]
for i in range(N):
    goto[0][i].add(i)
for i in range(M):
    a, b = map(int, input().split())
    goto[1][a].add(b)
for i in range(2, 60):
    for j in range(N):
        goto[i][j] = set()
        for g in goto[i - 1][j]:
            goto[i][j] |= goto[i - 1][g]
ans = set([0])
for i in range(59):
    if T >> i & 1:
        nex = set()
        for g in ans:
            nex |= goto[i + 1][g]
        ans = nex
print(len(ans))
0