結果

問題 No.1340 おーじ君をさがせ
ユーザー maspymaspy
提出日時 2020-10-07 13:59:59
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 549 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 77,952 KB
最終ジャッジ日時 2024-05-05 02:34:50
合計ジャッジ時間 7,399 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,840 KB
testcase_01 AC 39 ms
51,968 KB
testcase_02 AC 39 ms
51,968 KB
testcase_03 AC 39 ms
51,584 KB
testcase_04 AC 40 ms
51,840 KB
testcase_05 AC 39 ms
51,712 KB
testcase_06 AC 39 ms
51,968 KB
testcase_07 AC 41 ms
51,840 KB
testcase_08 AC 39 ms
52,096 KB
testcase_09 AC 40 ms
51,840 KB
testcase_10 AC 46 ms
59,520 KB
testcase_11 AC 57 ms
63,104 KB
testcase_12 AC 55 ms
61,696 KB
testcase_13 AC 51 ms
61,696 KB
testcase_14 AC 56 ms
67,456 KB
testcase_15 AC 55 ms
65,664 KB
testcase_16 AC 52 ms
61,568 KB
testcase_17 AC 49 ms
61,184 KB
testcase_18 AC 48 ms
63,360 KB
testcase_19 AC 47 ms
59,520 KB
testcase_20 AC 51 ms
60,672 KB
testcase_21 AC 158 ms
69,504 KB
testcase_22 AC 286 ms
71,808 KB
testcase_23 AC 148 ms
69,504 KB
testcase_24 AC 504 ms
75,904 KB
testcase_25 AC 60 ms
66,176 KB
testcase_26 AC 56 ms
64,640 KB
testcase_27 AC 56 ms
63,744 KB
testcase_28 AC 65 ms
66,560 KB
testcase_29 AC 51 ms
63,616 KB
testcase_30 AC 164 ms
69,760 KB
testcase_31 AC 925 ms
77,952 KB
testcase_32 AC 76 ms
77,056 KB
testcase_33 AC 76 ms
77,184 KB
testcase_34 AC 74 ms
77,312 KB
testcase_35 AC 84 ms
76,928 KB
testcase_36 AC 38 ms
51,712 KB
testcase_37 AC 46 ms
63,360 KB
testcase_38 AC 58 ms
75,008 KB
testcase_39 AC 78 ms
75,520 KB
testcase_40 AC 74 ms
73,344 KB
testcase_41 AC 72 ms
73,600 KB
testcase_42 AC 38 ms
51,840 KB
testcase_43 AC 37 ms
51,584 KB
testcase_44 AC 41 ms
57,856 KB
testcase_45 AC 40 ms
57,856 KB
testcase_46 AC 98 ms
65,408 KB
testcase_47 AC 154 ms
66,304 KB
testcase_48 AC 197 ms
67,200 KB
testcase_49 AC 66 ms
68,864 KB
testcase_50 AC 68 ms
69,888 KB
testcase_51 AC 73 ms
70,784 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 70 ms
71,040 KB
testcase_55 AC 410 ms
75,776 KB
testcase_56 AC 37 ms
51,840 KB
testcase_57 AC 35 ms
52,224 KB
testcase_58 AC 36 ms
51,712 KB
testcase_59 AC 47 ms
60,160 KB
testcase_60 AC 37 ms
52,352 KB
testcase_61 AC 51 ms
60,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 嘘

N, M, T, *nums = map(int, open(0).read().split())
G = set(zip(nums[::2], nums[1::2]))

T_max = min(N*N+10*N, T)
T0 = [-1] * N
T1 = [-1] * N
dp = [0] * N
dp[0] = 1
for t in range(T_max):
    newdp = [0] * N
    for frm, to in G:
        if dp[frm] and not newdp[to]:
            newdp[to] = 1
            T0[to], T1[to] = T1[to], t
    dp = newdp

ans = 0
for v in range(N):
    if T == T_max:
        ans += dp[v]
    else:
        t0, t1 = T0[v], T1[v]
        if t0 < N:
            continue
        ans += (T-t1) % (t1-t0) == 0
print(ans)
0