結果

問題 No.1974 2x2 Flipper
ユーザー vwxyzvwxyz
提出日時 2023-07-15 13:49:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 502 bytes
コンパイル時間 2,857 ms
コンパイル使用メモリ 11,760 KB
実行使用メモリ 19,116 KB
最終ジャッジ日時 2023-10-16 22:51:49
合計ジャッジ時間 9,534 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,068 KB
testcase_01 AC 80 ms
11,200 KB
testcase_02 AC 34 ms
10,448 KB
testcase_03 AC 347 ms
15,608 KB
testcase_04 AC 191 ms
12,988 KB
testcase_05 WA -
testcase_06 AC 253 ms
14,056 KB
testcase_07 AC 189 ms
12,864 KB
testcase_08 AC 57 ms
10,820 KB
testcase_09 AC 298 ms
14,588 KB
testcase_10 WA -
testcase_11 AC 233 ms
13,712 KB
testcase_12 AC 389 ms
16,116 KB
testcase_13 AC 242 ms
13,648 KB
testcase_14 AC 158 ms
12,332 KB
testcase_15 AC 446 ms
16,648 KB
testcase_16 WA -
testcase_17 AC 293 ms
14,680 KB
testcase_18 AC 61 ms
10,864 KB
testcase_19 AC 61 ms
10,896 KB
testcase_20 AC 187 ms
12,720 KB
testcase_21 AC 513 ms
18,316 KB
testcase_22 AC 577 ms
19,108 KB
testcase_23 AC 575 ms
19,116 KB
testcase_24 AC 513 ms
18,296 KB
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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])
0