結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,356 KB
testcase_01 AC 65 ms
71,436 KB
testcase_02 AC 67 ms
71,392 KB
testcase_03 AC 66 ms
71,220 KB
testcase_04 AC 106 ms
76,456 KB
testcase_05 AC 63 ms
71,036 KB
testcase_06 AC 67 ms
71,392 KB
testcase_07 AC 69 ms
71,244 KB
testcase_08 AC 67 ms
71,296 KB
testcase_09 AC 63 ms
71,336 KB
testcase_10 AC 66 ms
71,108 KB
testcase_11 AC 66 ms
71,148 KB
testcase_12 AC 105 ms
84,672 KB
testcase_13 AC 71 ms
76,168 KB
testcase_14 AC 80 ms
76,704 KB
testcase_15 AC 87 ms
76,608 KB
testcase_16 AC 87 ms
76,788 KB
testcase_17 AC 102 ms
76,652 KB
testcase_18 AC 111 ms
76,672 KB
testcase_19 AC 111 ms
76,292 KB
testcase_20 AC 76 ms
75,960 KB
testcase_21 AC 75 ms
75,972 KB
testcase_22 AC 68 ms
71,072 KB
testcase_23 AC 66 ms
71,356 KB
testcase_24 AC 70 ms
75,704 KB
testcase_25 AC 75 ms
76,040 KB
testcase_26 AC 70 ms
75,968 KB
testcase_27 AC 71 ms
75,996 KB
testcase_28 AC 103 ms
76,500 KB
testcase_29 AC 100 ms
76,732 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