結果

問題 No.1750 ラムドスウイルスの感染拡大-hard
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-11-20 11:08:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 521 bytes
コンパイル時間 553 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 84,812 KB
最終ジャッジ日時 2023-09-01 03:06:26
合計ジャッジ時間 18,115 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,672 KB
testcase_01 AC 67 ms
71,436 KB
testcase_02 AC 68 ms
71,492 KB
testcase_03 AC 78 ms
76,044 KB
testcase_04 WA -
testcase_05 AC 67 ms
71,364 KB
testcase_06 AC 67 ms
71,372 KB
testcase_07 AC 68 ms
71,284 KB
testcase_08 AC 305 ms
79,916 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 1,158 ms
83,580 KB
testcase_19 AC 1,149 ms
83,348 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,T = map(int, input().split())
l = [[0] * n for _ in range(n)]
for i in range(m):
    s,t = map(int, input().split())
    l[s][t]=1
    l[t][s]=1
rui = [[0] * n]
rui[0][0] = 1
mod = 998244353
def cal(mat_a, mat_b,r,c):
    new_mat = [[0]*c for _ in range(r)]
    for i in range(r):
        for j in range(c):
            new_mat[i][j] = sum(mat_a[i][w]*mat_b[w][j] % mod for w in range(r)) % mod
    return new_mat

while T:
    if T & 1:
        rui = cal(rui,l,1,n)
    l = cal(l,l,n,n)
    T >>= 1

print(rui[0][0])
0