結果

問題 No.1974 2x2 Flipper
ユーザー tassei903tassei903
提出日時 2022-03-24 23:37:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 733 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 81,624 KB
実行使用メモリ 85,332 KB
最終ジャッジ日時 2023-10-21 05:54:47
合計ジャッジ時間 5,187 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,404 KB
testcase_01 AC 64 ms
76,352 KB
testcase_02 AC 52 ms
64,140 KB
testcase_03 AC 108 ms
81,720 KB
testcase_04 AC 77 ms
78,120 KB
testcase_05 AC 69 ms
77,100 KB
testcase_06 AC 98 ms
79,764 KB
testcase_07 AC 80 ms
78,212 KB
testcase_08 AC 55 ms
73,916 KB
testcase_09 AC 98 ms
80,064 KB
testcase_10 AC 57 ms
73,856 KB
testcase_11 AC 83 ms
78,724 KB
testcase_12 AC 110 ms
81,580 KB
testcase_13 AC 89 ms
79,240 KB
testcase_14 AC 77 ms
77,496 KB
testcase_15 AC 120 ms
82,616 KB
testcase_16 AC 58 ms
75,932 KB
testcase_17 AC 100 ms
80,504 KB
testcase_18 AC 51 ms
73,036 KB
testcase_19 AC 60 ms
75,924 KB
testcase_20 AC 77 ms
78,092 KB
testcase_21 AC 139 ms
85,064 KB
testcase_22 AC 131 ms
85,332 KB
testcase_23 AC 144 ms
85,224 KB
testcase_24 AC 141 ms
85,252 KB
testcase_25 AC 34 ms
53,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

h,w = na()
a = [[1 for j in range(w)]for i in range(h)]
ans = h*w
if h%2 and w%2:
    for i in range(max(h,w)):
        x = min(i, h-1)
        y = min(i, w-1)
        a[x][y] = 0
        ans -= 1
elif h%2:
    for i in range(w):
        a[0][i] = 0
        ans -= 1
elif w%2:
    for i in range(h):
        a[i][0] = 0
        ans -= 1
print(ans)
for i in a:
    print(*i)
    
0