結果
問題 | No.1974 2x2 Flipper |
ユーザー |
![]() |
提出日時 | 2022-06-12 10:56:53 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 156 ms / 2,000 ms |
コード長 | 702 bytes |
コンパイル時間 | 198 ms |
コンパイル使用メモリ | 82,292 KB |
実行使用メモリ | 86,656 KB |
最終ジャッジ日時 | 2024-09-22 21:24:27 |
合計ジャッジ時間 | 5,562 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
h,w=map(int,input().split())s=[[1]*w for i in range(h)]def put(s):for l in s:print(*l)def cnt(s):res=0for i in range(h):for j in range(w):res+=s[i][j]print(res)if h%2==w%2==0:cnt(s)put(s)elif h%2==0 and w%2==1:for i in range(h):s[i][0]=0cnt(s)put(s)elif h%2==1 and w%2==0:for j in range(w):s[0][j]=0cnt(s)put(s)else:if h<w:for j in range(w-h):s[0][j]=0for j in range(w-h,w):s[(j-w+h)%h][j]=0cnt(s)put(s)else:for i in range(h-w):s[i][0]=0for i in range(h-w,h):s[i][(i-h+w)%w]=0cnt(s)put(s)