結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー brthyyjpbrthyyjp
提出日時 2021-11-22 00:42:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 642 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 77,488 KB
最終ジャッジ日時 2023-09-05 11:55:16
合計ジャッジ時間 4,633 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,372 KB
testcase_01 AC 73 ms
71,184 KB
testcase_02 AC 75 ms
71,072 KB
testcase_03 AC 74 ms
71,184 KB
testcase_04 AC 97 ms
76,660 KB
testcase_05 AC 73 ms
71,192 KB
testcase_06 AC 81 ms
76,644 KB
testcase_07 AC 82 ms
76,588 KB
testcase_08 AC 76 ms
71,232 KB
testcase_09 AC 78 ms
75,612 KB
testcase_10 AC 88 ms
76,460 KB
testcase_11 AC 88 ms
76,804 KB
testcase_12 AC 113 ms
76,668 KB
testcase_13 AC 80 ms
76,464 KB
testcase_14 AC 86 ms
76,348 KB
testcase_15 AC 88 ms
76,348 KB
testcase_16 AC 89 ms
76,824 KB
testcase_17 AC 101 ms
76,388 KB
testcase_18 AC 118 ms
76,900 KB
testcase_19 AC 117 ms
77,488 KB
testcase_20 AC 85 ms
76,544 KB
testcase_21 AC 88 ms
76,716 KB
testcase_22 AC 73 ms
71,344 KB
testcase_23 AC 80 ms
75,928 KB
testcase_24 AC 80 ms
76,088 KB
testcase_25 AC 87 ms
76,816 KB
testcase_26 AC 88 ms
76,740 KB
testcase_27 AC 84 ms
76,112 KB
testcase_28 AC 97 ms
76,676 KB
testcase_29 AC 96 ms
76,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import io, os
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline

n, m, t = map(int, input().split())
edge = [[] for i in range(n)]
for i in range(m):
    u, v = map(int, input().split())
    edge[u].append(v)
    edge[v].append(u)

mod = 998244353

dp = [0]*n
dp[0] = 1
for i in range(t):
    nx = [0]*n
    for v in range(n):
        for u in edge[v]:
            nx[v] += dp[u]
            nx[v] %= mod
    dp = nx
print(dp[0]%mod)
0