結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-23 12:25:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 875 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 11,016 KB
実行使用メモリ 36,528 KB
最終ジャッジ日時 2023-09-14 04:41:41
合計ジャッジ時間 8,281 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,968 KB
testcase_01 AC 17 ms
7,824 KB
testcase_02 AC 16 ms
7,792 KB
testcase_03 AC 16 ms
7,792 KB
testcase_04 AC 652 ms
9,936 KB
testcase_05 AC 16 ms
7,872 KB
testcase_06 AC 18 ms
7,960 KB
testcase_07 AC 17 ms
7,796 KB
testcase_08 AC 16 ms
7,872 KB
testcase_09 AC 17 ms
7,824 KB
testcase_10 AC 151 ms
16,240 KB
testcase_11 AC 156 ms
16,260 KB
testcase_12 AC 875 ms
31,436 KB
testcase_13 AC 21 ms
8,244 KB
testcase_14 AC 52 ms
8,264 KB
testcase_15 AC 158 ms
8,872 KB
testcase_16 AC 266 ms
9,460 KB
testcase_17 AC 647 ms
19,120 KB
testcase_18 AC 836 ms
36,528 KB
testcase_19 AC 655 ms
13,768 KB
testcase_20 AC 42 ms
8,972 KB
testcase_21 AC 37 ms
8,232 KB
testcase_22 AC 16 ms
7,968 KB
testcase_23 AC 17 ms
7,792 KB
testcase_24 AC 19 ms
7,912 KB
testcase_25 AC 147 ms
13,620 KB
testcase_26 AC 56 ms
10,060 KB
testcase_27 AC 38 ms
9,268 KB
testcase_28 AC 667 ms
9,792 KB
testcase_29 AC 593 ms
9,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,T=map(int,input().split())
mod=998244353
g=[[] for _ in range(n)]
for _ in range(m):
    s,t=map(int,input().split())
    g[s].append(t)
    g[t].append(s)
dp=[[0]*n for _ in range(T+1)]
dp[0][0]=1
for i in range(1,T+1):
    for j in range(n):
        for to in g[j]:
            dp[i][j]+=dp[i-1][to]
            dp[i][j]%=mod
print(dp[T][0])
0