結果

問題 No.2212 One XOR Matrix
ユーザー tassei903tassei903
提出日時 2023-02-11 02:28:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 212 ms / 2,000 ms
コード長 608 bytes
コンパイル時間 1,069 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 86,728 KB
最終ジャッジ日時 2023-09-22 02:34:04
合計ジャッジ時間 3,275 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,096 KB
testcase_01 AC 70 ms
71,596 KB
testcase_02 AC 69 ms
71,348 KB
testcase_03 AC 69 ms
71,480 KB
testcase_04 AC 74 ms
75,572 KB
testcase_05 AC 78 ms
76,704 KB
testcase_06 AC 80 ms
76,748 KB
testcase_07 AC 90 ms
77,736 KB
testcase_08 AC 111 ms
79,588 KB
testcase_09 AC 212 ms
86,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

n = ni()
if n == 1:
    print(-1)
    exit()
a = [[0] * (1<<n) for i in range(1<<n)]

for i in range(1<<n):
    for j in range(1<<n):
        a[(i+j)%(1<<n)][j] = i * (1<<n) + j

for i in range(1<<n-1):
    a[i*2][i*2], a[i*2+1][i*2+1] = a[i*2+1][i*2+1], a[i*2][i*2]


for i in a:
    print(*i)

0