結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー ああいいああいい
提出日時 2021-12-03 19:21:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 578 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 56,240 KB
最終ジャッジ日時 2023-09-20 04:22:26
合計ジャッジ時間 6,533 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
34,180 KB
testcase_01 AC 136 ms
29,504 KB
testcase_02 AC 137 ms
29,580 KB
testcase_03 AC 140 ms
29,656 KB
testcase_04 WA -
testcase_05 AC 136 ms
29,576 KB
testcase_06 AC 135 ms
29,644 KB
testcase_07 AC 134 ms
29,584 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
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 #

import numpy as np

N,M,T = list(map(int,input().split()))
d = [[0] * N for _ in range(N)]
P = 998244353

for _ in range(M):
    s,t = list(map(int,input().split()))
    d[s][t] = 1
    d[t][s] = 1
M = np.matrix(d)
power = [0] * 9
power[0] = M
for i in range(1,9):
    power[i] = power[i-1] ** 2 % P
def calc(n):
    ans = None
    flag = False
    for i in range(9):
        if n & (1 << i):
            if flag == False:
                ans = power[i]
                flag = True
            else:
                ans = ans * power[i] % P
    return ans

print(calc(T)[0,0])

0