結果

問題 No.2441 行列累乗
ユーザー irohasu19_irohasu19_
提出日時 2023-08-25 21:42:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 721 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 29,596 KB
最終ジャッジ日時 2023-08-25 21:42:51
合計ジャッジ時間 5,376 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
29,352 KB
testcase_01 AC 116 ms
29,584 KB
testcase_02 AC 117 ms
29,324 KB
testcase_03 AC 118 ms
29,372 KB
testcase_04 AC 118 ms
29,352 KB
testcase_05 AC 116 ms
29,460 KB
testcase_06 AC 116 ms
29,556 KB
testcase_07 AC 117 ms
29,400 KB
testcase_08 AC 118 ms
29,356 KB
testcase_09 AC 136 ms
29,596 KB
testcase_10 AC 127 ms
29,412 KB
testcase_11 AC 119 ms
29,348 KB
testcase_12 AC 119 ms
29,340 KB
testcase_13 AC 123 ms
29,416 KB
testcase_14 AC 126 ms
29,368 KB
testcase_15 AC 128 ms
29,404 KB
testcase_16 AC 129 ms
29,508 KB
testcase_17 AC 128 ms
29,368 KB
testcase_18 AC 137 ms
29,404 KB
testcase_19 AC 130 ms
29,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
import numpy as np
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n_1, n_2 = mi()
n_3, n_4 = mi()

m = np.matrix([[n_1, n_2], [n_3, n_4]])
m = m**3
print(m[0, 0], m[0, 1])
print(m[1, 0], m[1, 1])
0