結果

問題 No.1974 2x2 Flipper
ユーザー 👑 KazunKazun
提出日時 2022-06-10 22:06:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 854 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 81,748 KB
実行使用メモリ 85,648 KB
最終ジャッジ日時 2023-10-21 05:13:34
合計ジャッジ時間 5,508 ms
ジャッジサーバーID
(参考情報)
judge9 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,504 KB
testcase_01 AC 74 ms
76,596 KB
testcase_02 AC 52 ms
64,280 KB
testcase_03 AC 128 ms
82,008 KB
testcase_04 AC 86 ms
78,376 KB
testcase_05 WA -
testcase_06 AC 105 ms
80,016 KB
testcase_07 AC 92 ms
78,468 KB
testcase_08 AC 65 ms
76,112 KB
testcase_09 AC 109 ms
80,268 KB
testcase_10 WA -
testcase_11 AC 102 ms
79,144 KB
testcase_12 AC 126 ms
81,848 KB
testcase_13 AC 101 ms
79,512 KB
testcase_14 AC 84 ms
77,768 KB
testcase_15 AC 135 ms
82,896 KB
testcase_16 WA -
testcase_17 AC 116 ms
80,748 KB
testcase_18 AC 57 ms
73,508 KB
testcase_19 AC 68 ms
76,172 KB
testcase_20 AC 88 ms
78,348 KB
testcase_21 AC 155 ms
85,340 KB
testcase_22 AC 159 ms
85,648 KB
testcase_23 AC 160 ms
85,540 KB
testcase_24 WA -
testcase_25 AC 39 ms
53,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(H,W):
    A=[[0]*W for _ in range(H)]

    if H==1 or W==1:
        pass
    elif H%2==0:
        if W%2==0:
            for i in range(H):
                a=A[i]
                for j in range(W):
                    a[j]=1
        else:
            for i in range(H):
                a=A[i]
                for j in range(W-1):
                    a[j]=1
    else:
        if W%2==0:
            for i in range(H-1):
                a=A[i]
                for j in range(W):
                    a[j]=1
        else:
            for i in range(H-1):
                a=A[i]
                for j in range(W-1):
                    a[j]=1
            A[-2][-2]=0
            A[-2][-1]=A[-1][-2]=A[-1][-1]=1
    X=0
    for a in A:
        X+=sum(a)
    return X,A

H,W=map(int,input().split())
X,A=solve(H,W)

print(X)
for a in A:
    print(*a)
0