結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー 👑 H20H20
提出日時 2021-11-19 22:21:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 336 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 77,396 KB
最終ジャッジ日時 2023-08-30 09:01:31
合計ジャッジ時間 4,035 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,584 KB
testcase_01 AC 70 ms
71,348 KB
testcase_02 AC 69 ms
71,504 KB
testcase_03 AC 70 ms
71,184 KB
testcase_04 AC 103 ms
76,768 KB
testcase_05 AC 70 ms
71,336 KB
testcase_06 AC 78 ms
76,500 KB
testcase_07 AC 76 ms
76,512 KB
testcase_08 AC 69 ms
71,528 KB
testcase_09 AC 71 ms
75,760 KB
testcase_10 AC 78 ms
76,608 KB
testcase_11 AC 81 ms
76,560 KB
testcase_12 AC 120 ms
77,356 KB
testcase_13 AC 75 ms
76,604 KB
testcase_14 AC 86 ms
76,148 KB
testcase_15 AC 89 ms
76,340 KB
testcase_16 AC 93 ms
76,784 KB
testcase_17 AC 103 ms
77,340 KB
testcase_18 AC 118 ms
77,280 KB
testcase_19 AC 115 ms
77,396 KB
testcase_20 AC 80 ms
76,608 KB
testcase_21 AC 80 ms
76,588 KB
testcase_22 AC 70 ms
71,420 KB
testcase_23 AC 76 ms
75,864 KB
testcase_24 AC 76 ms
75,968 KB
testcase_25 AC 84 ms
76,764 KB
testcase_26 AC 84 ms
76,404 KB
testcase_27 AC 80 ms
76,256 KB
testcase_28 AC 98 ms
76,488 KB
testcase_29 AC 99 ms
76,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,T = map(int, input().split())
mod = 998244353
L = [[] for i in range(N)]
for i in range(M):
    a,b = map(int, input().split())
    L[a].append(b)
    L[b].append(a)
DP = [0] * N
DP[0] = 1
for i in range(T):
    NDP = [0]*N
    for j in range(N):
        for l in L[j]:
            NDP[l]=(DP[j]+NDP[l])%mod
    DP=NDP
print(DP[0])
0