結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー cookie63cookie63
提出日時 2023-01-24 20:35:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 188 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 84,568 KB
最終ジャッジ日時 2023-09-08 13:25:45
合計ジャッジ時間 5,243 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,700 KB
testcase_01 AC 96 ms
71,672 KB
testcase_02 AC 95 ms
71,660 KB
testcase_03 AC 95 ms
71,628 KB
testcase_04 AC 134 ms
77,248 KB
testcase_05 AC 94 ms
71,696 KB
testcase_06 AC 106 ms
77,748 KB
testcase_07 AC 107 ms
77,744 KB
testcase_08 AC 99 ms
76,308 KB
testcase_09 AC 104 ms
77,392 KB
testcase_10 AC 128 ms
77,740 KB
testcase_11 AC 135 ms
77,652 KB
testcase_12 AC 165 ms
77,484 KB
testcase_13 AC 110 ms
77,684 KB
testcase_14 AC 120 ms
77,200 KB
testcase_15 AC 122 ms
76,948 KB
testcase_16 AC 126 ms
77,508 KB
testcase_17 AC 144 ms
77,696 KB
testcase_18 AC 188 ms
84,568 KB
testcase_19 AC 181 ms
83,328 KB
testcase_20 AC 114 ms
77,816 KB
testcase_21 AC 113 ms
77,692 KB
testcase_22 AC 95 ms
71,632 KB
testcase_23 AC 106 ms
77,524 KB
testcase_24 AC 103 ms
77,188 KB
testcase_25 AC 130 ms
77,860 KB
testcase_26 AC 119 ms
77,592 KB
testcase_27 AC 114 ms
77,560 KB
testcase_28 AC 135 ms
77,744 KB
testcase_29 AC 133 ms
77,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
MOD = 998244353
n, m, t = map(int, input().split())
g = defaultdict(list)
for i in range(m):
    s, _t = map(int, input().split())
    g[s].append(_t)
    g[_t].append(s)

dp = [[0 for v in range(n)] for i in range(t+1)]
dp[0][0] = 1
for i in range(1, t+1):
    for v in range(n):
        for u in g[v]:
            dp[i][v] += dp[i-1][u] % MOD
        dp[i][v] %= MOD

print(dp[t][0])
0