結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,112 KB
testcase_01 AC 80 ms
11,244 KB
testcase_02 AC 33 ms
10,488 KB
testcase_03 AC 343 ms
15,644 KB
testcase_04 AC 190 ms
13,028 KB
testcase_05 WA -
testcase_06 AC 251 ms
14,092 KB
testcase_07 AC 186 ms
12,900 KB
testcase_08 AC 57 ms
10,864 KB
testcase_09 AC 298 ms
14,620 KB
testcase_10 WA -
testcase_11 AC 235 ms
13,744 KB
testcase_12 AC 389 ms
16,144 KB
testcase_13 AC 241 ms
13,676 KB
testcase_14 AC 159 ms
12,372 KB
testcase_15 AC 448 ms
16,680 KB
testcase_16 WA -
testcase_17 AC 292 ms
14,716 KB
testcase_18 AC 62 ms
10,916 KB
testcase_19 AC 61 ms
10,932 KB
testcase_20 AC 187 ms
12,752 KB
testcase_21 AC 511 ms
18,348 KB
testcase_22 AC 573 ms
19,140 KB
testcase_23 AC 573 ms
19,148 KB
testcase_24 WA -
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 if h!=H-1 and w!=W-1 else 0 for w in range(W)] for h in range(H)]
    ans_lst[H-2][W-2]=0
    ans_lst[H-2][W-1]=1
    ans_lst[H-1][W-2]=1
    ans_lst[H-1][W-1]=1
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