結果

問題 No.2441 行列累乗
ユーザー rlangevinrlangevin
提出日時 2023-08-27 14:46:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 674 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 71,540 KB
最終ジャッジ日時 2023-08-27 14:46:18
合計ジャッジ時間 3,315 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,092 KB
testcase_01 AC 66 ms
70,940 KB
testcase_02 AC 66 ms
71,128 KB
testcase_03 AC 65 ms
70,992 KB
testcase_04 AC 66 ms
71,020 KB
testcase_05 AC 68 ms
71,048 KB
testcase_06 AC 68 ms
71,028 KB
testcase_07 AC 67 ms
70,980 KB
testcase_08 AC 67 ms
70,804 KB
testcase_09 AC 66 ms
71,100 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

M = []
for i in range(2):
    M.append(list(map(int, input().split())))
    
def prod(A, B):
    C = [[0] * 2 for i in range(2)]
    for i in range(2):
        for j in range(2):
            for k in range(2):
                C[i][j] += A[i][k] * B[k][j]
    return C

M2 = prod(M, M)
M3 = prod(M2, M)
for m in M:
    print(*m)
0