結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー 👑 rin204rin204
提出日時 2022-01-18 02:06:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 1,134 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 76,444 KB
最終ジャッジ日時 2023-08-15 07:14:01
合計ジャッジ時間 5,044 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
71,300 KB
testcase_01 AC 61 ms
71,372 KB
testcase_02 AC 61 ms
71,244 KB
testcase_03 AC 64 ms
71,128 KB
testcase_04 AC 91 ms
76,288 KB
testcase_05 AC 63 ms
71,112 KB
testcase_06 AC 62 ms
71,368 KB
testcase_07 AC 62 ms
71,372 KB
testcase_08 AC 62 ms
71,080 KB
testcase_09 AC 64 ms
71,076 KB
testcase_10 AC 65 ms
71,236 KB
testcase_11 AC 65 ms
70,948 KB
testcase_12 AC 90 ms
75,964 KB
testcase_13 AC 69 ms
75,828 KB
testcase_14 AC 84 ms
75,972 KB
testcase_15 AC 85 ms
76,324 KB
testcase_16 AC 89 ms
76,444 KB
testcase_17 AC 97 ms
76,288 KB
testcase_18 AC 95 ms
76,432 KB
testcase_19 AC 93 ms
76,316 KB
testcase_20 AC 66 ms
75,912 KB
testcase_21 AC 67 ms
75,932 KB
testcase_22 AC 61 ms
71,376 KB
testcase_23 AC 61 ms
71,372 KB
testcase_24 AC 67 ms
75,784 KB
testcase_25 AC 70 ms
76,008 KB
testcase_26 AC 69 ms
76,096 KB
testcase_27 AC 71 ms
76,204 KB
testcase_28 AC 91 ms
76,172 KB
testcase_29 AC 88 ms
76,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

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