結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
37,468 KB
testcase_01 AC 132 ms
32,104 KB
testcase_02 AC 131 ms
30,676 KB
testcase_03 AC 127 ms
30,376 KB
testcase_04 AC 127 ms
30,572 KB
testcase_05 AC 127 ms
30,508 KB
testcase_06 AC 139 ms
30,768 KB
testcase_07 WA -
testcase_08 AC 131 ms
30,484 KB
testcase_09 AC 130 ms
30,744 KB
testcase_10 AC 130 ms
30,576 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 129 ms
32,400 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
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 = np.linalg.inv(p) @ d @ 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