結果

問題 No.1340 おーじ君をさがせ
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-01-15 22:56:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 663 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 82,728 KB
実行使用メモリ 80,512 KB
最終ジャッジ日時 2024-05-05 21:55:25
合計ジャッジ時間 10,767 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
58,624 KB
testcase_01 AC 37 ms
52,224 KB
testcase_02 AC 38 ms
52,096 KB
testcase_03 AC 38 ms
52,224 KB
testcase_04 AC 38 ms
52,352 KB
testcase_05 AC 38 ms
52,608 KB
testcase_06 AC 38 ms
52,196 KB
testcase_07 AC 36 ms
52,480 KB
testcase_08 AC 37 ms
52,480 KB
testcase_09 AC 36 ms
52,096 KB
testcase_10 AC 48 ms
60,928 KB
testcase_11 AC 50 ms
63,104 KB
testcase_12 AC 63 ms
65,280 KB
testcase_13 AC 45 ms
60,800 KB
testcase_14 AC 53 ms
63,616 KB
testcase_15 AC 44 ms
59,648 KB
testcase_16 AC 58 ms
62,464 KB
testcase_17 AC 43 ms
58,880 KB
testcase_18 AC 44 ms
59,392 KB
testcase_19 AC 43 ms
59,264 KB
testcase_20 AC 47 ms
60,416 KB
testcase_21 AC 187 ms
77,044 KB
testcase_22 AC 373 ms
77,880 KB
testcase_23 AC 181 ms
76,768 KB
testcase_24 AC 642 ms
80,256 KB
testcase_25 AC 88 ms
76,576 KB
testcase_26 AC 79 ms
73,856 KB
testcase_27 AC 75 ms
72,576 KB
testcase_28 AC 96 ms
76,800 KB
testcase_29 AC 70 ms
72,576 KB
testcase_30 AC 201 ms
77,088 KB
testcase_31 AC 663 ms
77,056 KB
testcase_32 AC 78 ms
77,056 KB
testcase_33 AC 78 ms
77,056 KB
testcase_34 AC 144 ms
76,672 KB
testcase_35 AC 146 ms
77,016 KB
testcase_36 AC 37 ms
51,840 KB
testcase_37 AC 66 ms
72,960 KB
testcase_38 AC 73 ms
74,136 KB
testcase_39 AC 509 ms
76,904 KB
testcase_40 AC 502 ms
76,988 KB
testcase_41 AC 492 ms
76,672 KB
testcase_42 AC 36 ms
52,352 KB
testcase_43 AC 36 ms
52,864 KB
testcase_44 AC 37 ms
52,096 KB
testcase_45 AC 37 ms
52,224 KB
testcase_46 AC 359 ms
79,744 KB
testcase_47 AC 347 ms
80,000 KB
testcase_48 AC 347 ms
80,096 KB
testcase_49 AC 489 ms
73,052 KB
testcase_50 AC 490 ms
72,960 KB
testcase_51 AC 488 ms
72,832 KB
testcase_52 AC 50 ms
63,104 KB
testcase_53 AC 50 ms
63,488 KB
testcase_54 AC 49 ms
63,104 KB
testcase_55 AC 171 ms
80,512 KB
testcase_56 AC 39 ms
52,708 KB
testcase_57 AC 38 ms
52,224 KB
testcase_58 AC 37 ms
52,352 KB
testcase_59 AC 48 ms
62,080 KB
testcase_60 AC 37 ms
52,096 KB
testcase_61 AC 48 ms
62,080 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