結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,508 KB
testcase_01 AC 69 ms
76,620 KB
testcase_02 AC 50 ms
64,428 KB
testcase_03 AC 122 ms
82,148 KB
testcase_04 AC 86 ms
78,488 KB
testcase_05 WA -
testcase_06 AC 104 ms
80,000 KB
testcase_07 AC 90 ms
78,604 KB
testcase_08 AC 60 ms
74,380 KB
testcase_09 AC 106 ms
80,412 KB
testcase_10 WA -
testcase_11 AC 94 ms
79,092 KB
testcase_12 AC 122 ms
82,120 KB
testcase_13 AC 98 ms
79,432 KB
testcase_14 AC 81 ms
77,800 KB
testcase_15 AC 131 ms
83,240 KB
testcase_16 WA -
testcase_17 AC 115 ms
80,948 KB
testcase_18 AC 55 ms
73,364 KB
testcase_19 AC 65 ms
76,280 KB
testcase_20 AC 85 ms
78,396 KB
testcase_21 AC 152 ms
85,592 KB
testcase_22 AC 151 ms
85,596 KB
testcase_23 AC 153 ms
85,696 KB
testcase_24 WA -
testcase_25 AC 37 ms
53,508 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
    print(H * W - H - W  + 2)
    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