結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー 河野竜也河野竜也
提出日時 2022-06-21 13:17:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,007 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 39,296 KB
最終ジャッジ日時 2024-04-22 07:22:25
合計ジャッジ時間 8,846 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 33 ms
10,752 KB
testcase_02 AC 33 ms
10,880 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 709 ms
12,288 KB
testcase_05 AC 30 ms
10,624 KB
testcase_06 AC 33 ms
10,752 KB
testcase_07 AC 33 ms
10,752 KB
testcase_08 AC 31 ms
11,008 KB
testcase_09 AC 31 ms
10,880 KB
testcase_10 AC 229 ms
18,816 KB
testcase_11 AC 219 ms
18,688 KB
testcase_12 AC 929 ms
33,920 KB
testcase_13 AC 35 ms
10,880 KB
testcase_14 AC 68 ms
11,008 KB
testcase_15 AC 188 ms
11,520 KB
testcase_16 AC 315 ms
12,160 KB
testcase_17 AC 807 ms
21,888 KB
testcase_18 AC 1,007 ms
39,296 KB
testcase_19 AC 761 ms
16,384 KB
testcase_20 AC 58 ms
11,520 KB
testcase_21 AC 54 ms
11,008 KB
testcase_22 AC 31 ms
10,624 KB
testcase_23 AC 31 ms
10,752 KB
testcase_24 AC 34 ms
10,752 KB
testcase_25 AC 190 ms
16,256 KB
testcase_26 AC 81 ms
12,672 KB
testcase_27 AC 61 ms
11,776 KB
testcase_28 AC 708 ms
12,288 KB
testcase_29 AC 675 ms
12,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,t=map(int,input().split())
s=[set() for i in range(n)]
for i in range(m):
    x,y=map(int,input().split())
    s[x].add(y)
    s[y].add(x)
    
dp=[[0]*n for i in range(t+1)]
dp[0][0]=1
mod=998244353 

for i in range(1,t+1):
    for j in range(n):
        for k in s[j]:
            dp[i][j] += dp[i-1][k]
            dp[i][j] %= mod
            
print(dp[-1][0]%mod)
0