結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー titiatitia
提出日時 2021-11-19 22:02:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 77,244 KB
最終ジャッジ日時 2023-08-30 08:30:55
合計ジャッジ時間 4,246 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,316 KB
testcase_01 AC 71 ms
71,384 KB
testcase_02 AC 67 ms
71,444 KB
testcase_03 AC 69 ms
71,196 KB
testcase_04 AC 83 ms
76,676 KB
testcase_05 AC 69 ms
71,256 KB
testcase_06 AC 75 ms
76,420 KB
testcase_07 AC 74 ms
76,732 KB
testcase_08 AC 69 ms
71,404 KB
testcase_09 AC 72 ms
75,924 KB
testcase_10 AC 80 ms
76,408 KB
testcase_11 AC 80 ms
76,712 KB
testcase_12 AC 104 ms
76,464 KB
testcase_13 AC 75 ms
76,604 KB
testcase_14 AC 77 ms
76,172 KB
testcase_15 AC 78 ms
76,056 KB
testcase_16 AC 80 ms
76,384 KB
testcase_17 AC 91 ms
76,424 KB
testcase_18 AC 112 ms
77,244 KB
testcase_19 AC 105 ms
77,204 KB
testcase_20 AC 81 ms
76,464 KB
testcase_21 AC 81 ms
76,460 KB
testcase_22 AC 70 ms
71,152 KB
testcase_23 AC 74 ms
75,904 KB
testcase_24 AC 74 ms
75,928 KB
testcase_25 AC 84 ms
76,496 KB
testcase_26 AC 82 ms
76,212 KB
testcase_27 AC 81 ms
75,908 KB
testcase_28 AC 82 ms
76,392 KB
testcase_29 AC 82 ms
76,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M,T=map(int,input().split())
mod=998244353

DP=[0]*N
DP[0]=1

E=[[] for i in range(N)]
for i in range(M):
    s,t=map(int,input().split())
    E[s].append(t)
    E[t].append(s)
    
for i in range(T):
    NDP=[0]*N

    for j in range(N):
        x=0
        for to in E[j]:
            x+=DP[to]
        NDP[j]=x%mod

    DP=NDP

print(DP[0])
0