結果
問題 |
No.1974 2x2 Flipper
|
ユーザー |
![]() |
提出日時 | 2025-06-12 19:20:11 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 684 bytes |
コンパイル時間 | 340 ms |
コンパイル使用メモリ | 82,228 KB |
実行使用メモリ | 77,036 KB |
最終ジャッジ日時 | 2025-06-12 19:20:18 |
合計ジャッジ時間 | 5,814 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 25 |
ソースコード
H, W = map(int, input().split()) if H == 1 and W == 1: print(1) print(1) elif H == 1 or W == 1: ans = 2 print(ans) if H == 1: row = [1 if j < 2 else 0 for j in range(W)] print(' '.join(map(str, row))) else: for i in range(H): row = [1 if i == 0 or i == H-1 else 0 for j in range(W)] print(' '.join(map(str, row))) else: ans = 4 print(ans) # Fill the top-left 2x2 with 1s, rest with 0 for i in range(H): row = [] for j in range(W): if i < 2 and j < 2: row.append(1) else: row.append(0) print(' '.join(map(str, row)))