結果

問題 No.2663 Zero-Sum Submatrices
ユーザー Ekiben542Ekiben542
提出日時 2024-03-08 21:08:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 384 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 68,600 KB
最終ジャッジ日時 2024-03-08 21:08:27
合計ジャッジ時間 3,134 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 38 ms
53,460 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 35 ms
53,460 KB
testcase_08 WA -
testcase_09 AC 43 ms
59,072 KB
testcase_10 AC 48 ms
62,216 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 48 ms
62,216 KB
testcase_14 AC 36 ms
53,460 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 49 ms
64,308 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 43 ms
59,072 KB
testcase_24 AC 50 ms
64,308 KB
testcase_25 WA -
testcase_26 AC 60 ms
68,600 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 60 ms
68,600 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(n, m):
    N = 1 << (n + m)
    ans = [0] * N
    for i in range(N):
        ans[i] = i ^ (i // 2)
    if m & 1:
        for i in range(N):
            ans[i] ^= ans[i] >> m
            ans[i] ^= ans[i] << m
    for i in range(1 << n):
        for j in range(1 << m):
            print(ans[i << m | j], end=' ')
        print()

n, m = map(int, input().split())
solve(n, m)
0