結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー ああいいああいい
提出日時 2022-03-16 17:20:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 81,592 KB
実行使用メモリ 72,388 KB
最終ジャッジ日時 2023-10-24 22:28:15
合計ジャッジ時間 3,764 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,364 KB
testcase_01 AC 42 ms
53,364 KB
testcase_02 AC 40 ms
53,364 KB
testcase_03 AC 39 ms
53,364 KB
testcase_04 AC 66 ms
66,244 KB
testcase_05 AC 38 ms
53,364 KB
testcase_06 AC 45 ms
59,892 KB
testcase_07 AC 44 ms
59,892 KB
testcase_08 AC 39 ms
53,364 KB
testcase_09 AC 41 ms
57,420 KB
testcase_10 AC 48 ms
68,136 KB
testcase_11 AC 49 ms
68,136 KB
testcase_12 AC 71 ms
72,388 KB
testcase_13 AC 48 ms
62,088 KB
testcase_14 AC 58 ms
63,792 KB
testcase_15 AC 59 ms
63,792 KB
testcase_16 AC 63 ms
66,244 KB
testcase_17 AC 67 ms
68,292 KB
testcase_18 AC 70 ms
72,388 KB
testcase_19 AC 69 ms
70,340 KB
testcase_20 AC 49 ms
62,144 KB
testcase_21 AC 48 ms
62,144 KB
testcase_22 AC 40 ms
53,364 KB
testcase_23 AC 44 ms
59,468 KB
testcase_24 AC 45 ms
59,556 KB
testcase_25 AC 52 ms
66,240 KB
testcase_26 AC 48 ms
62,144 KB
testcase_27 AC 46 ms
61,604 KB
testcase_28 AC 65 ms
66,244 KB
testcase_29 AC 67 ms
66,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,T = map(int,input().split())
edge = []
for _ in range(M):
    s,t = map(int,input().split())
    edge.append((s,t))

dp = [0] * N
dp[0] = 1
P = 998244353
for _ in range(T):
    nx = [0] * N
    for s,t in edge:
        nx[t] += dp[s]
        nx[s] += dp[t]
    for i in range(N):
        nx[i] %= P
    dp = nx
print(dp[0])
0