結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,332 KB
testcase_01 AC 69 ms
76,440 KB
testcase_02 AC 51 ms
64,260 KB
testcase_03 AC 123 ms
81,976 KB
testcase_04 AC 86 ms
78,316 KB
testcase_05 WA -
testcase_06 AC 104 ms
79,836 KB
testcase_07 AC 90 ms
78,436 KB
testcase_08 AC 61 ms
74,204 KB
testcase_09 AC 106 ms
80,236 KB
testcase_10 WA -
testcase_11 AC 94 ms
78,920 KB
testcase_12 AC 125 ms
81,988 KB
testcase_13 AC 98 ms
79,264 KB
testcase_14 AC 81 ms
77,636 KB
testcase_15 AC 133 ms
83,076 KB
testcase_16 WA -
testcase_17 AC 114 ms
80,824 KB
testcase_18 AC 56 ms
73,192 KB
testcase_19 AC 66 ms
76,104 KB
testcase_20 AC 86 ms
78,232 KB
testcase_21 AC 155 ms
85,500 KB
testcase_22 AC 156 ms
85,428 KB
testcase_23 AC 156 ms
85,536 KB
testcase_24 WA -
testcase_25 AC 38 ms
53,392 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
if H % 2 == 1 and W % 2 == 1:
    for h in range(H):
        for w in range(W):
            A[h][w] = 1
    for h in range(H - 1):
        A[h][-2] = 0
    for w in range(W - 1):
        A[-2][w] = 0
    for h in range(H):
        print(*A[h])
    exit()
for h in range(hend):
    for w in range(wend):
        A[h][w] = 1
print(wend * hend)
for h in range(H):
    print(*A[h])
0