結果

問題 No.1974 2x2 Flipper
ユーザー 👑 H20H20
提出日時 2022-06-10 22:44:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 859 ms
コンパイル使用メモリ 81,688 KB
実行使用メモリ 85,296 KB
最終ジャッジ日時 2023-10-21 05:59:59
合計ジャッジ時間 5,371 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,788 KB
testcase_01 AC 60 ms
76,428 KB
testcase_02 AC 43 ms
62,460 KB
testcase_03 AC 107 ms
81,824 KB
testcase_04 AC 78 ms
78,224 KB
testcase_05 AC 70 ms
77,208 KB
testcase_06 AC 93 ms
79,868 KB
testcase_07 AC 81 ms
78,256 KB
testcase_08 AC 54 ms
73,900 KB
testcase_09 AC 90 ms
80,172 KB
testcase_10 AC 57 ms
73,708 KB
testcase_11 AC 82 ms
78,848 KB
testcase_12 AC 102 ms
81,724 KB
testcase_13 AC 87 ms
79,352 KB
testcase_14 AC 69 ms
77,548 KB
testcase_15 AC 118 ms
82,812 KB
testcase_16 AC 58 ms
75,964 KB
testcase_17 AC 100 ms
80,652 KB
testcase_18 AC 50 ms
72,872 KB
testcase_19 AC 62 ms
75,944 KB
testcase_20 AC 75 ms
78,244 KB
testcase_21 AC 130 ms
85,196 KB
testcase_22 AC 140 ms
85,156 KB
testcase_23 AC 135 ms
85,256 KB
testcase_24 AC 132 ms
85,296 KB
testcase_25 AC 35 ms
51,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W = map(int, input().split())
MAP = [[1]*W for _ in range(H)]
if H>1 and W>1 and H%2==1 and W%2==1:
    for i in range(max(H,W)):
        MAP[min(i,H-1)][min(i,W-1)]=0
elif H%2==1:
    MAP[H-1]=[0]*W
elif W%2==1:
    for i in range(H):
        MAP[i][W-1]=0

ans = 0
for map in MAP:
    ans+=sum(map)

print(ans)
for map in MAP:
    print(*map)
0