結果

問題 No.2212 One XOR Matrix
ユーザー ニックネームニックネーム
提出日時 2023-02-10 22:37:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 191 ms / 2,000 ms
コード長 387 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 88,660 KB
最終ジャッジ日時 2023-09-21 23:47:29
合計ジャッジ時間 3,585 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,432 KB
testcase_01 AC 70 ms
71,292 KB
testcase_02 AC 75 ms
71,344 KB
testcase_03 AC 72 ms
71,140 KB
testcase_04 AC 77 ms
75,172 KB
testcase_05 AC 84 ms
76,776 KB
testcase_06 AC 86 ms
76,688 KB
testcase_07 AC 94 ms
77,880 KB
testcase_08 AC 116 ms
79,696 KB
testcase_09 AC 191 ms
88,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
if n==1: exit(print(-1))
a = [[7,14,0,8],[4,12,2,11],[15,9,6,1],[13,10,5,3]]
for i in range(2,n):
    m = 2**i
    b = [[0]*2*m for _ in range(2*m)]
    for i in range(m):
        for j in range(m):
            b[i][j] = a[i][j]
            b[i][j+m] = m*i+j+m*m
            b[i+m][j+m] = a[i][j]+2*m*m
            b[i+m][j] = m*i+j+3*m*m
    a = b
for s in a: print(*s)
0