結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー lloyzlloyz
提出日時 2021-11-19 22:29:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 442 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 78,108 KB
最終ジャッジ日時 2023-08-30 09:15:34
合計ジャッジ時間 4,931 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,680 KB
testcase_01 AC 92 ms
71,716 KB
testcase_02 AC 90 ms
71,592 KB
testcase_03 AC 92 ms
71,860 KB
testcase_04 AC 129 ms
77,676 KB
testcase_05 AC 92 ms
71,652 KB
testcase_06 AC 106 ms
77,420 KB
testcase_07 AC 105 ms
77,588 KB
testcase_08 AC 89 ms
71,808 KB
testcase_09 AC 96 ms
77,208 KB
testcase_10 AC 118 ms
77,984 KB
testcase_11 AC 118 ms
77,992 KB
testcase_12 AC 159 ms
77,944 KB
testcase_13 AC 100 ms
77,916 KB
testcase_14 AC 112 ms
77,520 KB
testcase_15 AC 115 ms
77,560 KB
testcase_16 AC 120 ms
77,768 KB
testcase_17 AC 134 ms
77,772 KB
testcase_18 AC 162 ms
77,936 KB
testcase_19 AC 163 ms
78,108 KB
testcase_20 AC 106 ms
77,824 KB
testcase_21 AC 106 ms
77,984 KB
testcase_22 AC 89 ms
71,636 KB
testcase_23 AC 98 ms
77,428 KB
testcase_24 AC 97 ms
77,276 KB
testcase_25 AC 117 ms
77,856 KB
testcase_26 AC 108 ms
77,980 KB
testcase_27 AC 103 ms
77,616 KB
testcase_28 AC 122 ms
77,740 KB
testcase_29 AC 123 ms
77,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict, deque

n, m, t = map(int, input().split())
edge = defaultdict(list)
for _ in range(m):
    a, b = map(int, input().split())
    edge[a].append(b)
    edge[b].append(a)
mod = 998244353

dp = [0 for _ in range(n)]
dp[0] = 1
for _ in range(t):
    ndp = [0 for _ in range(n)]
    for i in range(n):
        for j in edge[i]:
            ndp[j] += dp[i]
            ndp[j] %= mod
    dp = ndp[:]
print(dp[0])
0