結果

問題 No.1340 おーじ君をさがせ
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-01-15 22:56:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 557 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 1,180 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 87,624 KB
最終ジャッジ日時 2023-08-18 16:43:15
合計ジャッジ時間 12,167 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,672 KB
testcase_01 AC 72 ms
71,228 KB
testcase_02 AC 71 ms
71,356 KB
testcase_03 AC 71 ms
71,124 KB
testcase_04 AC 71 ms
71,324 KB
testcase_05 AC 72 ms
71,280 KB
testcase_06 AC 71 ms
71,160 KB
testcase_07 AC 72 ms
71,428 KB
testcase_08 AC 70 ms
71,388 KB
testcase_09 AC 72 ms
71,168 KB
testcase_10 AC 80 ms
76,256 KB
testcase_11 AC 82 ms
76,396 KB
testcase_12 AC 90 ms
76,468 KB
testcase_13 AC 77 ms
76,024 KB
testcase_14 AC 84 ms
76,452 KB
testcase_15 AC 76 ms
75,584 KB
testcase_16 AC 87 ms
76,324 KB
testcase_17 AC 75 ms
75,804 KB
testcase_18 AC 75 ms
75,836 KB
testcase_19 AC 75 ms
76,008 KB
testcase_20 AC 78 ms
76,228 KB
testcase_21 AC 192 ms
77,748 KB
testcase_22 AC 336 ms
77,804 KB
testcase_23 AC 188 ms
77,704 KB
testcase_24 AC 551 ms
78,772 KB
testcase_25 AC 112 ms
77,600 KB
testcase_26 AC 110 ms
77,560 KB
testcase_27 AC 106 ms
78,220 KB
testcase_28 AC 118 ms
77,124 KB
testcase_29 AC 98 ms
76,892 KB
testcase_30 AC 200 ms
77,732 KB
testcase_31 AC 557 ms
77,840 KB
testcase_32 AC 103 ms
77,740 KB
testcase_33 AC 105 ms
77,672 KB
testcase_34 AC 157 ms
77,732 KB
testcase_35 AC 157 ms
77,748 KB
testcase_36 AC 70 ms
71,136 KB
testcase_37 AC 99 ms
76,984 KB
testcase_38 AC 104 ms
77,620 KB
testcase_39 AC 444 ms
77,736 KB
testcase_40 AC 436 ms
77,856 KB
testcase_41 AC 436 ms
77,992 KB
testcase_42 AC 71 ms
70,924 KB
testcase_43 AC 71 ms
70,964 KB
testcase_44 AC 71 ms
71,284 KB
testcase_45 AC 70 ms
71,064 KB
testcase_46 AC 320 ms
78,852 KB
testcase_47 AC 322 ms
78,652 KB
testcase_48 AC 322 ms
78,688 KB
testcase_49 AC 439 ms
87,348 KB
testcase_50 AC 437 ms
87,528 KB
testcase_51 AC 439 ms
87,624 KB
testcase_52 AC 82 ms
76,204 KB
testcase_53 AC 82 ms
76,408 KB
testcase_54 AC 81 ms
76,344 KB
testcase_55 AC 179 ms
79,528 KB
testcase_56 AC 71 ms
71,312 KB
testcase_57 AC 71 ms
71,128 KB
testcase_58 AC 70 ms
70,916 KB
testcase_59 AC 79 ms
76,336 KB
testcase_60 AC 69 ms
71,072 KB
testcase_61 AC 83 ms
76,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,t = map(int,input().split())
e = [[] for i in range(n)]
db = [[set() for j in range(n)] for i in range(70)]

for i in range(m):
    a,b = map(int,input().split())
    db[0][a].add(b)
for i in range(1,60):
    for j in range(n):
        for k in db[i-1][j]:
            db[i][j] |= db[i-1][k]

ans = set([0])
for i in range(60):
    if t >> i & 1:
        nex = set()
        for j in ans:
            nex |= db[i][j]
        ans = nex
print(len(ans))
0