結果

問題 No.2447 行列累乗根
ユーザー risujirohrisujiroh
提出日時 2023-08-25 23:30:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 396 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 39,188 KB
最終ジャッジ日時 2023-08-25 23:30:58
合計ジャッジ時間 9,955 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
39,188 KB
testcase_01 AC 122 ms
30,588 KB
testcase_02 AC 116 ms
30,596 KB
testcase_03 AC 119 ms
30,480 KB
testcase_04 AC 122 ms
30,504 KB
testcase_05 AC 120 ms
31,976 KB
testcase_06 AC 120 ms
31,968 KB
testcase_07 AC 122 ms
32,116 KB
testcase_08 AC 132 ms
30,768 KB
testcase_09 AC 118 ms
30,600 KB
testcase_10 AC 118 ms
31,980 KB
testcase_11 AC 121 ms
30,452 KB
testcase_12 AC 116 ms
30,632 KB
testcase_13 AC 116 ms
30,528 KB
testcase_14 AC 120 ms
30,788 KB
testcase_15 AC 117 ms
30,576 KB
testcase_16 AC 117 ms
32,084 KB
testcase_17 AC 122 ms
30,656 KB
testcase_18 AC 153 ms
32,272 KB
testcase_19 AC 481 ms
30,708 KB
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

import numpy as np


def solve() -> None:
    input = sys.stdin.readline
    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