結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー tnodinotnodino
提出日時 2023-07-09 18:15:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 85,068 KB
最終ジャッジ日時 2023-09-30 21:46:00
合計ジャッジ時間 5,258 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,048 KB
testcase_01 AC 73 ms
71,228 KB
testcase_02 AC 73 ms
71,336 KB
testcase_03 AC 74 ms
71,296 KB
testcase_04 AC 113 ms
76,540 KB
testcase_05 AC 72 ms
71,324 KB
testcase_06 AC 81 ms
76,392 KB
testcase_07 AC 85 ms
76,340 KB
testcase_08 AC 73 ms
71,296 KB
testcase_09 AC 76 ms
75,380 KB
testcase_10 AC 85 ms
76,432 KB
testcase_11 AC 85 ms
76,124 KB
testcase_12 AC 140 ms
85,068 KB
testcase_13 AC 79 ms
76,316 KB
testcase_14 AC 94 ms
76,084 KB
testcase_15 AC 97 ms
76,436 KB
testcase_16 AC 105 ms
76,340 KB
testcase_17 AC 120 ms
79,412 KB
testcase_18 AC 140 ms
83,796 KB
testcase_19 AC 139 ms
82,836 KB
testcase_20 AC 86 ms
76,584 KB
testcase_21 AC 88 ms
76,328 KB
testcase_22 AC 73 ms
71,340 KB
testcase_23 AC 78 ms
75,944 KB
testcase_24 AC 79 ms
76,084 KB
testcase_25 AC 90 ms
76,484 KB
testcase_26 AC 86 ms
76,392 KB
testcase_27 AC 83 ms
75,960 KB
testcase_28 AC 108 ms
76,328 KB
testcase_29 AC 106 ms
76,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
N,M,T = map(int,input().split())
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(T):
    for pos in range(N):
        for nxt in G[pos]:
            DP[i+1][nxt] += DP[i][pos]
            DP[i+1][nxt] %= mod
print(DP[T][0])
0