結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー suosuo
提出日時 2021-11-19 21:41:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 86,824 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2023-08-30 07:50:26
合計ジャッジ時間 4,749 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,200 KB
testcase_01 AC 72 ms
70,968 KB
testcase_02 AC 74 ms
71,168 KB
testcase_03 AC 72 ms
71,196 KB
testcase_04 AC 124 ms
76,524 KB
testcase_05 AC 70 ms
71,500 KB
testcase_06 AC 81 ms
76,488 KB
testcase_07 AC 83 ms
76,660 KB
testcase_08 AC 71 ms
71,196 KB
testcase_09 AC 74 ms
75,668 KB
testcase_10 AC 86 ms
76,568 KB
testcase_11 AC 86 ms
76,572 KB
testcase_12 AC 126 ms
77,284 KB
testcase_13 AC 78 ms
76,600 KB
testcase_14 AC 93 ms
76,372 KB
testcase_15 AC 94 ms
76,476 KB
testcase_16 AC 99 ms
76,800 KB
testcase_17 AC 109 ms
77,224 KB
testcase_18 AC 126 ms
77,440 KB
testcase_19 AC 124 ms
77,436 KB
testcase_20 AC 85 ms
76,516 KB
testcase_21 AC 85 ms
76,512 KB
testcase_22 AC 72 ms
71,060 KB
testcase_23 AC 77 ms
76,060 KB
testcase_24 AC 80 ms
76,132 KB
testcase_25 AC 91 ms
76,648 KB
testcase_26 AC 85 ms
76,656 KB
testcase_27 AC 81 ms
76,224 KB
testcase_28 AC 107 ms
76,668 KB
testcase_29 AC 105 ms
76,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,T = map(int,input().split())
load = [[] for i in range(n)]
for i in range(m):
  s,t = map(int,input().split())
  load[s].append(t)
  load[t].append(s)
mod = 998244353
dp = [0 for i in range(n)]
dp[0] = 1
for i in range(T):
  new = [0 for j in range(n)]
  for j in range(n):
    for k in load[j]:
      new[j] += dp[k]
      new[j] %= mod
  dp = new
print(dp[0])
0