結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー tobusakanatobusakana
提出日時 2022-11-25 22:54:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,264 KB
実行使用メモリ 76,420 KB
最終ジャッジ日時 2024-04-10 04:00:45
合計ジャッジ時間 2,992 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,612 KB
testcase_01 AC 39 ms
52,004 KB
testcase_02 AC 39 ms
52,460 KB
testcase_03 AC 39 ms
53,576 KB
testcase_04 AC 67 ms
67,356 KB
testcase_05 AC 35 ms
53,204 KB
testcase_06 AC 44 ms
61,064 KB
testcase_07 AC 44 ms
61,068 KB
testcase_08 AC 37 ms
52,560 KB
testcase_09 AC 39 ms
58,056 KB
testcase_10 AC 50 ms
70,164 KB
testcase_11 AC 50 ms
68,780 KB
testcase_12 AC 91 ms
74,180 KB
testcase_13 AC 44 ms
60,544 KB
testcase_14 AC 58 ms
66,740 KB
testcase_15 AC 59 ms
65,232 KB
testcase_16 AC 61 ms
67,172 KB
testcase_17 AC 74 ms
74,872 KB
testcase_18 AC 94 ms
76,420 KB
testcase_19 AC 91 ms
76,296 KB
testcase_20 AC 53 ms
64,028 KB
testcase_21 AC 50 ms
65,084 KB
testcase_22 AC 37 ms
53,348 KB
testcase_23 AC 41 ms
59,268 KB
testcase_24 AC 42 ms
60,576 KB
testcase_25 AC 52 ms
68,188 KB
testcase_26 AC 53 ms
65,504 KB
testcase_27 AC 50 ms
63,236 KB
testcase_28 AC 67 ms
68,072 KB
testcase_29 AC 66 ms
67,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,T = map(int,input().split())
G = [[] for i in range(N)]
for i in range(M):
    s,t = map(int,input().split())
    G[s].append(t)
    G[t].append(s)
    
dp = [0] * N
dp[0] = 1

DIV = 998244353
for _ in range(T):
    new_dp = [0] * N
    for i in range(N):
        for child in G[i]:
            new_dp[child] += dp[i]
            new_dp[child] %= DIV
    dp = new_dp
print(dp[0])
            
0