結果

問題 No.1974 2x2 Flipper
ユーザー ああいいああいい
提出日時 2022-06-12 07:27:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 607 bytes
コンパイル時間 514 ms
コンパイル使用メモリ 81,728 KB
実行使用メモリ 85,596 KB
最終ジャッジ日時 2023-10-24 00:12:43
合計ジャッジ時間 6,084 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,492 KB
testcase_01 AC 67 ms
76,580 KB
testcase_02 AC 49 ms
64,364 KB
testcase_03 AC 116 ms
81,944 KB
testcase_04 AC 82 ms
78,360 KB
testcase_05 WA -
testcase_06 AC 98 ms
79,936 KB
testcase_07 AC 86 ms
78,584 KB
testcase_08 AC 59 ms
74,264 KB
testcase_09 AC 99 ms
80,384 KB
testcase_10 WA -
testcase_11 AC 89 ms
79,028 KB
testcase_12 AC 112 ms
82,124 KB
testcase_13 AC 91 ms
79,372 KB
testcase_14 AC 77 ms
77,736 KB
testcase_15 AC 117 ms
83,220 KB
testcase_16 WA -
testcase_17 AC 104 ms
80,948 KB
testcase_18 AC 54 ms
73,260 KB
testcase_19 AC 62 ms
76,208 KB
testcase_20 AC 80 ms
78,316 KB
testcase_21 AC 138 ms
85,596 KB
testcase_22 AC 141 ms
85,588 KB
testcase_23 AC 140 ms
85,476 KB
testcase_24 WA -
testcase_25 AC 37 ms
53,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W = map(int,input().split())

import sys
if H == 1 or W == 1:
    print(0)
    for h in range(H):
        for w in range(W):
            print(0,end = " ")
        print()
    exit()
ans = [[0] * W for _ in range(H)]
A = ans
if W % 2 == 1:
    wend = W - 1
else:
    wend = W
if H % 2 == 1:
    hend = H - 1
else:
    hend = H

for h in range(hend):
    for w in range(wend):
        A[h][w] = 1
t = wend * hend
if H % 2 == 1 and W % 2 == 1:
    for h in range(hend - 1,hend + 1):
        for w in range(wend - 1,wend + 1):
            A[h][w] ^= 1
    t += 2
print(t)
for h in range(H):
    print(*A[h])
0