結果

問題 No.2212 One XOR Matrix
ユーザー titiatitia
提出日時 2023-02-11 00:52:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 508 bytes
コンパイル時間 522 ms
コンパイル使用メモリ 10,796 KB
実行使用メモリ 51,516 KB
最終ジャッジ日時 2023-09-22 01:23:44
合計ジャッジ時間 4,534 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 16 ms
8,244 KB
testcase_02 AC 16 ms
7,768 KB
testcase_03 AC 16 ms
7,832 KB
testcase_04 AC 17 ms
8,300 KB
testcase_05 AC 20 ms
8,576 KB
testcase_06 AC 32 ms
8,732 KB
testcase_07 AC 81 ms
10,948 KB
testcase_08 AC 280 ms
19,156 KB
testcase_09 AC 1,142 ms
51,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
if N==1:
    print(-1)
    exit()

A=[[7,14,0,8],[4,12,2,11],[15,9,6,1],[13,10,5,3]]

for b in range(N-2):
    B=[[-1]*(len(A)*2) for i in range(len(A)*2)]

    for i in range(len(A)):
        for j in range(len(A)):
            B[i][j]=A[i][j]
            B[i+len(A)][j]=(i*len(A)+j)|(1<<(b*2+4))
            B[i][j+len(A)]=(i*len(A)+j)|(1<<(b*2+5))
            B[i+len(A)][j+len(A)]=A[i][j]|(1<<(b*2+4))|(1<<(b*2+5))

    A=B

for b in B:
    print(*b)
0