結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー 👑 timitimi
提出日時 2021-11-19 22:13:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 271 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 78,836 KB
最終ジャッジ日時 2023-08-30 08:49:34
合計ジャッジ時間 5,753 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,672 KB
testcase_01 AC 92 ms
71,552 KB
testcase_02 AC 91 ms
71,540 KB
testcase_03 AC 97 ms
71,612 KB
testcase_04 AC 205 ms
78,056 KB
testcase_05 AC 91 ms
71,532 KB
testcase_06 AC 99 ms
72,520 KB
testcase_07 AC 98 ms
72,316 KB
testcase_08 AC 90 ms
71,592 KB
testcase_09 AC 91 ms
71,536 KB
testcase_10 AC 98 ms
72,492 KB
testcase_11 AC 97 ms
72,212 KB
testcase_12 AC 242 ms
78,448 KB
testcase_13 AC 107 ms
77,700 KB
testcase_14 AC 125 ms
77,780 KB
testcase_15 AC 142 ms
77,832 KB
testcase_16 AC 162 ms
78,204 KB
testcase_17 AC 228 ms
78,068 KB
testcase_18 AC 271 ms
78,836 KB
testcase_19 AC 254 ms
78,536 KB
testcase_20 AC 120 ms
77,880 KB
testcase_21 AC 120 ms
77,840 KB
testcase_22 AC 93 ms
71,668 KB
testcase_23 AC 93 ms
71,384 KB
testcase_24 AC 109 ms
77,620 KB
testcase_25 AC 119 ms
77,948 KB
testcase_26 AC 109 ms
77,884 KB
testcase_27 AC 107 ms
77,860 KB
testcase_28 AC 204 ms
78,368 KB
testcase_29 AC 210 ms
78,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

from collections import defaultdict
D=defaultdict(int)
D[0]=1
mod=998244353
for i in range(T):
  DD=defaultdict(int)
  for s,t in E:
    DD[s]+=D[t]
    DD[t]+=D[s]
    DD[s]%=mod
    DD[t]%=mod
  D=DD
print(D[0])
0