結果

問題 No.2441 行列累乗
ユーザー FromBooskaFromBooska
提出日時 2023-08-25 21:27:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 29,668 KB
最終ジャッジ日時 2023-08-25 21:27:15
合計ジャッジ時間 3,876 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
29,536 KB
testcase_01 AC 130 ms
29,660 KB
testcase_02 AC 131 ms
29,516 KB
testcase_03 AC 130 ms
29,516 KB
testcase_04 AC 130 ms
29,572 KB
testcase_05 AC 131 ms
29,436 KB
testcase_06 AC 131 ms
29,524 KB
testcase_07 AC 157 ms
29,668 KB
testcase_08 AC 131 ms
29,588 KB
testcase_09 AC 130 ms
29,396 KB
testcase_10 AC 129 ms
29,560 KB
testcase_11 AC 131 ms
29,524 KB
testcase_12 AC 132 ms
29,528 KB
testcase_13 AC 132 ms
29,584 KB
testcase_14 AC 131 ms
29,508 KB
testcase_15 AC 131 ms
29,612 KB
testcase_16 AC 137 ms
29,604 KB
testcase_17 AC 136 ms
29,524 KB
testcase_18 AC 133 ms
29,468 KB
testcase_19 AC 132 ms
29,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
#np.set_printoptions(precision=10, floatmode='maxprec')
#original = np.array([[1, 0], [0, 1]])
N1, N2 = map(int, input().split())
N3, N4 = map(int, input().split())
M = np.array([[N1, N2], [N3, N4]])
ans = np.linalg.matrix_power(M, 3)
print(*ans[0])
print(*ans[1])
0