結果

問題 No.1974 2x2 Flipper
ユーザー ニックネームニックネーム
提出日時 2022-06-10 22:38:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 12,044 KB
実行使用メモリ 18,444 KB
最終ジャッジ日時 2023-10-21 05:29:31
合計ジャッジ時間 12,050 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,144 KB
testcase_01 AC 113 ms
11,288 KB
testcase_02 AC 37 ms
10,520 KB
testcase_03 AC 547 ms
15,672 KB
testcase_04 AC 256 ms
12,796 KB
testcase_05 WA -
testcase_06 AC 390 ms
14,132 KB
testcase_07 AC 251 ms
12,828 KB
testcase_08 AC 70 ms
10,880 KB
testcase_09 AC 411 ms
14,204 KB
testcase_10 WA -
testcase_11 AC 317 ms
13,148 KB
testcase_12 AC 537 ms
15,524 KB
testcase_13 AC 323 ms
13,584 KB
testcase_14 AC 210 ms
12,092 KB
testcase_15 AC 614 ms
16,524 KB
testcase_16 WA -
testcase_17 AC 446 ms
14,732 KB
testcase_18 AC 73 ms
10,904 KB
testcase_19 AC 73 ms
10,972 KB
testcase_20 AC 250 ms
12,620 KB
testcase_21 AC 793 ms
18,388 KB
testcase_22 AC 797 ms
18,384 KB
testcase_23 AC 803 ms
18,380 KB
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

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