結果

問題 No.1340 おーじ君をさがせ
ユーザー maspymaspy
提出日時 2020-10-07 13:57:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 566 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 78,336 KB
最終ジャッジ日時 2024-05-05 02:34:28
合計ジャッジ時間 7,267 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,096 KB
testcase_01 AC 38 ms
52,352 KB
testcase_02 AC 36 ms
51,712 KB
testcase_03 AC 35 ms
52,224 KB
testcase_04 AC 34 ms
51,968 KB
testcase_05 AC 36 ms
52,608 KB
testcase_06 AC 34 ms
52,224 KB
testcase_07 AC 34 ms
52,224 KB
testcase_08 AC 35 ms
52,096 KB
testcase_09 AC 34 ms
52,352 KB
testcase_10 AC 50 ms
63,360 KB
testcase_11 AC 59 ms
66,688 KB
testcase_12 AC 56 ms
66,048 KB
testcase_13 AC 45 ms
65,920 KB
testcase_14 AC 46 ms
68,224 KB
testcase_15 AC 47 ms
67,584 KB
testcase_16 AC 59 ms
65,920 KB
testcase_17 AC 46 ms
65,408 KB
testcase_18 AC 41 ms
66,688 KB
testcase_19 AC 42 ms
63,104 KB
testcase_20 AC 51 ms
64,256 KB
testcase_21 AC 287 ms
73,728 KB
testcase_22 AC 362 ms
74,624 KB
testcase_23 AC 277 ms
73,600 KB
testcase_24 AC 439 ms
74,240 KB
testcase_25 AC 94 ms
70,400 KB
testcase_26 AC 81 ms
68,096 KB
testcase_27 AC 71 ms
67,200 KB
testcase_28 AC 121 ms
70,400 KB
testcase_29 AC 55 ms
66,688 KB
testcase_30 AC 302 ms
73,984 KB
testcase_31 AC 796 ms
78,336 KB
testcase_32 AC 57 ms
75,960 KB
testcase_33 AC 56 ms
75,776 KB
testcase_34 AC 56 ms
75,648 KB
testcase_35 AC 69 ms
77,440 KB
testcase_36 AC 36 ms
58,752 KB
testcase_37 AC 44 ms
66,304 KB
testcase_38 AC 47 ms
74,624 KB
testcase_39 AC 61 ms
75,904 KB
testcase_40 AC 56 ms
73,856 KB
testcase_41 AC 61 ms
73,728 KB
testcase_42 AC 37 ms
51,840 KB
testcase_43 AC 35 ms
52,352 KB
testcase_44 WA -
testcase_45 AC 43 ms
59,008 KB
testcase_46 AC 98 ms
65,536 KB
testcase_47 AC 140 ms
66,688 KB
testcase_48 AC 177 ms
67,712 KB
testcase_49 AC 56 ms
69,248 KB
testcase_50 AC 56 ms
70,016 KB
testcase_51 AC 59 ms
71,040 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 55 ms
70,528 KB
testcase_55 AC 352 ms
73,856 KB
testcase_56 AC 44 ms
62,720 KB
testcase_57 AC 45 ms
62,592 KB
testcase_58 AC 44 ms
61,824 KB
testcase_59 AC 41 ms
60,672 KB
testcase_60 AC 34 ms
51,968 KB
testcase_61 AC 44 ms
60,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 嘘解法

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

T_max = min(T, 10000)

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 == -1:
            continue
        ans += (T-t1) % (t1-t0) == 0
print(ans)
0