結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー H3PO4H3PO4
提出日時 2021-11-19 21:40:26
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 791 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 76,916 KB
最終ジャッジ日時 2023-08-30 07:48:09
合計ジャッジ時間 4,417 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,028 KB
testcase_01 AC 69 ms
71,104 KB
testcase_02 AC 69 ms
71,412 KB
testcase_03 AC 69 ms
71,140 KB
testcase_04 AC 106 ms
76,544 KB
testcase_05 AC 69 ms
71,440 KB
testcase_06 AC 72 ms
71,272 KB
testcase_07 AC 73 ms
71,032 KB
testcase_08 AC 70 ms
71,272 KB
testcase_09 AC 70 ms
71,408 KB
testcase_10 AC 72 ms
71,056 KB
testcase_11 AC 73 ms
71,064 KB
testcase_12 AC 104 ms
76,468 KB
testcase_13 AC 77 ms
76,312 KB
testcase_14 AC 88 ms
76,648 KB
testcase_15 AC 91 ms
76,676 KB
testcase_16 AC 95 ms
76,344 KB
testcase_17 AC 103 ms
76,684 KB
testcase_18 AC 106 ms
76,464 KB
testcase_19 AC 104 ms
76,724 KB
testcase_20 AC 77 ms
76,252 KB
testcase_21 AC 76 ms
75,996 KB
testcase_22 AC 71 ms
71,296 KB
testcase_23 AC 74 ms
71,336 KB
testcase_24 AC 76 ms
76,132 KB
testcase_25 AC 78 ms
76,232 KB
testcase_26 AC 77 ms
76,204 KB
testcase_27 AC 74 ms
75,780 KB
testcase_28 AC 103 ms
76,804 KB
testcase_29 AC 102 ms
76,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

edges = [tuple(map(int, input().split())) for _ in range(M)]

dp = [0] * N
dp[0] = 1
for _ in range(T):
    new_dp = [0] * N
    for s, t in edges:
        new_dp[s] += dp[t]
        new_dp[s] %= MOD
        new_dp[t] += dp[s]
        new_dp[t] %= MOD
    dp = new_dp
print(dp[0])
0