結果
問題 |
No.1974 2x2 Flipper
|
ユーザー |
![]() |
提出日時 | 2023-07-15 13:49:01 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 502 bytes |
コンパイル時間 | 374 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 19,584 KB |
最終ジャッジ日時 | 2024-09-16 22:37:25 |
合計ジャッジ時間 | 10,453 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 21 WA * 4 |
ソースコード
import sys readline=sys.stdin.readline H,W=map(int,readline().split()) if H%2==0 and W%2==0: ans_lst=[[1]*W for h in range(H)] elif H%2==0: ans_lst=[[1 if w!=W-1 else 0 for w in range(W)] for h in range(H)] elif W%2==0: ans_lst=[[1 if h!=H-1 else 0 for w in range(W)] for h in range(H)] else: ans_lst=[[1 ]*W for h in range(H)] for i in range(min(H,W)): ans_lst[i][i]=0 print(sum(ans_lst[h][w] for h in range(H) for w in range(W))) for h in range(H): print(*ans_lst[h])