結果

問題 No.2447 行列累乗根
ユーザー risujirohrisujiroh
提出日時 2023-08-25 23:24:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 353 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 10,588 KB
実行使用メモリ 34,972 KB
最終ジャッジ日時 2023-08-25 23:24:26
合計ジャッジ時間 10,666 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
32,108 KB
testcase_01 AC 126 ms
30,348 KB
testcase_02 AC 127 ms
30,460 KB
testcase_03 AC 126 ms
30,364 KB
testcase_04 AC 127 ms
30,652 KB
testcase_05 AC 126 ms
32,220 KB
testcase_06 AC 131 ms
30,688 KB
testcase_07 AC 127 ms
30,404 KB
testcase_08 AC 127 ms
32,116 KB
testcase_09 AC 129 ms
30,364 KB
testcase_10 AC 127 ms
32,340 KB
testcase_11 AC 126 ms
30,364 KB
testcase_12 AC 125 ms
30,496 KB
testcase_13 AC 125 ms
30,384 KB
testcase_14 AC 137 ms
30,616 KB
testcase_15 AC 124 ms
30,608 KB
testcase_16 AC 126 ms
30,520 KB
testcase_17 AC 131 ms
30,636 KB
testcase_18 AC 175 ms
32,092 KB
testcase_19 AC 626 ms
30,496 KB
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np


def solve() -> None:
    a = np.array([list(map(float, input().split())) for _ in range(2)])
    d, p = np.linalg.eigh(a)
    d = np.diag(np.cbrt(d))
    a = p @ d @ np.linalg.inv(p)
    for i in range(2):
        for j in range(2):
            print(f"{a[i, j]:.5f}", end=" \n"[j == 1])


for _ in range(int(input())):
    solve()
0