結果

問題 No.1750 ラムドスウイルスの感染拡大-hard
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-11-20 11:13:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,177 ms / 2,000 ms
コード長 521 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 85,180 KB
最終ジャッジ日時 2023-09-01 03:21:29
合計ジャッジ時間 17,210 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,124 KB
testcase_01 AC 68 ms
71,440 KB
testcase_02 AC 69 ms
71,184 KB
testcase_03 AC 75 ms
75,996 KB
testcase_04 AC 147 ms
77,860 KB
testcase_05 AC 68 ms
71,632 KB
testcase_06 AC 67 ms
71,272 KB
testcase_07 AC 68 ms
71,504 KB
testcase_08 AC 302 ms
79,696 KB
testcase_09 AC 298 ms
79,696 KB
testcase_10 AC 299 ms
79,544 KB
testcase_11 AC 273 ms
80,356 KB
testcase_12 AC 297 ms
79,252 KB
testcase_13 AC 295 ms
79,368 KB
testcase_14 AC 1,174 ms
82,964 KB
testcase_15 AC 1,154 ms
85,180 KB
testcase_16 AC 1,177 ms
84,800 KB
testcase_17 AC 1,175 ms
84,292 KB
testcase_18 AC 1,139 ms
83,056 KB
testcase_19 AC 1,135 ms
83,576 KB
testcase_20 AC 859 ms
82,188 KB
testcase_21 AC 958 ms
83,228 KB
testcase_22 AC 283 ms
79,152 KB
testcase_23 AC 1,038 ms
82,772 KB
testcase_24 AC 253 ms
79,540 KB
testcase_25 AC 391 ms
79,916 KB
testcase_26 AC 209 ms
78,216 KB
testcase_27 AC 92 ms
77,308 KB
testcase_28 AC 102 ms
77,516 KB
testcase_29 AC 97 ms
77,840 KB
testcase_30 AC 269 ms
79,264 KB
testcase_31 AC 281 ms
79,120 KB
testcase_32 AC 277 ms
78,824 KB
testcase_33 AC 265 ms
79,332 KB
権限があれば一括ダウンロードができます

ソースコード

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(c)) % 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