結果

問題 No.1974 2x2 Flipper
ユーザー prussian_coderprussian_coder
提出日時 2022-06-10 22:26:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 1,174 ms
コンパイル使用メモリ 81,632 KB
実行使用メモリ 77,540 KB
最終ジャッジ日時 2023-10-21 05:58:42
合計ジャッジ時間 5,278 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
53,288 KB
testcase_01 AC 71 ms
75,120 KB
testcase_02 AC 50 ms
63,852 KB
testcase_03 AC 112 ms
76,388 KB
testcase_04 AC 81 ms
75,720 KB
testcase_05 AC 77 ms
75,576 KB
testcase_06 AC 95 ms
75,804 KB
testcase_07 AC 84 ms
75,624 KB
testcase_08 AC 58 ms
73,816 KB
testcase_09 AC 98 ms
76,112 KB
testcase_10 AC 79 ms
75,456 KB
testcase_11 AC 89 ms
75,956 KB
testcase_12 AC 115 ms
76,760 KB
testcase_13 AC 92 ms
75,748 KB
testcase_14 AC 75 ms
75,484 KB
testcase_15 AC 124 ms
76,580 KB
testcase_16 AC 68 ms
75,504 KB
testcase_17 AC 103 ms
76,124 KB
testcase_18 AC 53 ms
72,260 KB
testcase_19 AC 64 ms
75,300 KB
testcase_20 AC 81 ms
75,728 KB
testcase_21 AC 142 ms
77,192 KB
testcase_22 AC 142 ms
77,196 KB
testcase_23 AC 144 ms
77,268 KB
testcase_24 AC 151 ms
77,540 KB
testcase_25 AC 39 ms
53,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W=map(int,input().split())
if H%2==0 and W%2==0:
	print(H*W)
	[print(*[1]*W) for _ in range(H)]
elif H%2!=0 and W%2==0:
	print((H-1)*W)
	[print(*[1]*W) for _ in range(H-1)]
	print(*[0]*W)
elif W%2!=0 and H%2==0:
	print((W-1)*H)
	[print(*[1]*(W-1)+[0]) for _ in range(H)]
else:
	print(H*W-max(H,W))
	d=[1,0]
	[print(*[d[min(i,W-1)==min(j,H-1)] for j in range(W)]) for i in range(H)]
0