結果
問題 |
No.1974 2x2 Flipper
|
ユーザー |
![]() |
提出日時 | 2022-06-12 01:55:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 534 ms / 2,000 ms |
コード長 | 642 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 19,072 KB |
最終ジャッジ日時 | 2024-09-22 12:10:27 |
合計ジャッジ時間 | 9,354 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
H,W=map(int,input().split()) ANS=[[1]*W for i in range(H)] if H%2==0 and W%2==0: print(H*W) for ans in ANS: print(*ans) elif H%2==1 and W%2==0: print(H*W-W) for i in range(W): ANS[0][i]=0 for ans in ANS: print(*ans) elif H%2==0 and W%2==1: print(H*W-H) for i in range(H): ANS[i][0]=0 for ans in ANS: print(*ans) else: if H<=W: for i in range(W): ANS[min(i,H-1)][i]=0 print(H*W-W) else: for i in range(H): ANS[i][min(i,W-1)]=0 print(H*W-H) for ans in ANS: print(*ans)