結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー ramdosramdos
提出日時 2021-10-14 10:44:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 392 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 35,232 KB
最終ジャッジ日時 2024-06-10 06:53:52
合計ジャッジ時間 5,571 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
17,820 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 30 ms
10,880 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 925 ms
12,416 KB
testcase_05 AC 33 ms
10,752 KB
testcase_06 AC 35 ms
11,008 KB
testcase_07 AC 33 ms
10,880 KB
testcase_08 AC 214 ms
19,456 KB
testcase_09 AC 346 ms
19,456 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,T=map(int, input().split())
vec=[[0 for i in range(N)] for j in range(N)]
for i in range(M):
  vs,vt=map(int, input().split())
  vec[vs][vt]=1
  vec[vt][vs]=1
dp=[[0 for i in range(N)] for j in range(T+1)]
dp[0][0]=1
for i in range(T):
  for j in range(N):
    for k in range(N):
      if(vec[j][k]==1):
        dp[i+1][j]+=dp[i][k]
        dp[i+1][j]%=998244353
print(dp[T][0]%998244353)
0