結果

問題 No.1974 2x2 Flipper
ユーザー ニックネーム
提出日時 2022-06-10 22:38:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 110 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 18,944 KB
最終ジャッジ日時 2024-09-21 06:36:58
合計ジャッジ時間 12,914 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 20 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
a = [[0]*w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if i < h//2*2 and j < w//2*2: a[i][j] ^= 1
ans = (h//2*2)*(w//2*2)
if h*w%2:
    for i in range(h-2, h):
        for j in range(w-2, w): a[i][j] ^= 1
    ans += 2
print(ans)
for s in a: print(*s)
0