結果

問題 No.1974 2x2 Flipper
ユーザー lam6er
提出日時 2025-04-15 21:48:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 450 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 82,324 KB
実行使用メモリ 85,028 KB
最終ジャッジ日時 2025-04-15 21:49:42
合計ジャッジ時間 5,122 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

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

# Calculate the maximum number of black cells
max_rows = H - (H % 2)
max_cols = W - (W % 2)
ans = max_rows * max_cols

# Generate the grid
grid = []
for i in range(H):
    row = []
    for j in range(W):
        if i < max_rows and j < max_cols:
            row.append(1)
        else:
            row.append(0)
    grid.append(row)

# Output the result
print(ans)
for row in grid:
    print(' '.join(map(str, row)))
0