結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー irumo8202irumo8202
提出日時 2022-01-27 17:48:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 372 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 84,832 KB
最終ジャッジ日時 2023-08-26 18:52:50
合計ジャッジ時間 3,669 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,196 KB
testcase_01 AC 62 ms
71,100 KB
testcase_02 AC 65 ms
71,280 KB
testcase_03 AC 62 ms
71,120 KB
testcase_04 AC 97 ms
76,528 KB
testcase_05 AC 63 ms
71,336 KB
testcase_06 AC 64 ms
71,144 KB
testcase_07 AC 65 ms
71,036 KB
testcase_08 AC 62 ms
71,108 KB
testcase_09 AC 61 ms
71,352 KB
testcase_10 AC 61 ms
71,048 KB
testcase_11 AC 63 ms
71,108 KB
testcase_12 AC 100 ms
84,832 KB
testcase_13 AC 69 ms
76,000 KB
testcase_14 AC 79 ms
76,672 KB
testcase_15 AC 88 ms
76,816 KB
testcase_16 AC 92 ms
76,500 KB
testcase_17 AC 104 ms
76,568 KB
testcase_18 AC 105 ms
76,668 KB
testcase_19 AC 102 ms
76,460 KB
testcase_20 AC 70 ms
76,036 KB
testcase_21 AC 69 ms
75,972 KB
testcase_22 AC 64 ms
71,396 KB
testcase_23 AC 61 ms
71,144 KB
testcase_24 AC 71 ms
75,984 KB
testcase_25 AC 69 ms
76,108 KB
testcase_26 AC 69 ms
75,820 KB
testcase_27 AC 69 ms
75,960 KB
testcase_28 AC 100 ms
76,632 KB
testcase_29 AC 99 ms
76,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

dp = [[0] * N for _ in range(T + 1)]
dp[0][0] = 1

for i in range(1, T + 1):
    for u, v in edges:
        dp[i][u] += dp[i - 1][v]
        dp[i][u] %= MOD
        dp[i][v] += dp[i - 1][u]
        dp[i][v] %= MOD

print(dp[-1][0])
0