結果

問題 No.2212 One XOR Matrix
ユーザー KudeKude
提出日時 2023-02-10 22:11:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 522 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 88,856 KB
最終ジャッジ日時 2023-09-21 23:26:43
合計ジャッジ時間 3,696 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,448 KB
testcase_01 AC 75 ms
71,440 KB
testcase_02 AC 77 ms
71,556 KB
testcase_03 AC 77 ms
71,392 KB
testcase_04 AC 81 ms
75,652 KB
testcase_05 AC 89 ms
76,760 KB
testcase_06 AC 95 ms
77,080 KB
testcase_07 AC 103 ms
78,056 KB
testcase_08 AC 126 ms
79,700 KB
testcase_09 AC 211 ms
88,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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