結果

問題 No.2112 All 2x2 are Equal
ユーザー 👑 KazunKazun
提出日時 2022-10-28 22:25:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 1,494 ms
コンパイル使用メモリ 86,708 KB
実行使用メモリ 124,704 KB
最終ジャッジ日時 2023-09-20 05:29:18
合計ジャッジ時間 11,203 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,076 KB
testcase_01 AC 75 ms
70,944 KB
testcase_02 AC 100 ms
76,468 KB
testcase_03 AC 92 ms
76,540 KB
testcase_04 AC 161 ms
95,340 KB
testcase_05 AC 177 ms
103,200 KB
testcase_06 AC 231 ms
119,960 KB
testcase_07 AC 139 ms
89,636 KB
testcase_08 AC 206 ms
111,628 KB
testcase_09 AC 97 ms
77,920 KB
testcase_10 AC 150 ms
92,812 KB
testcase_11 AC 127 ms
87,668 KB
testcase_12 AC 141 ms
89,416 KB
testcase_13 AC 213 ms
115,784 KB
testcase_14 AC 94 ms
77,276 KB
testcase_15 AC 182 ms
103,672 KB
testcase_16 AC 85 ms
76,292 KB
testcase_17 AC 204 ms
111,312 KB
testcase_18 AC 92 ms
76,492 KB
testcase_19 AC 102 ms
79,036 KB
testcase_20 AC 103 ms
77,444 KB
testcase_21 AC 202 ms
110,732 KB
testcase_22 AC 92 ms
77,544 KB
testcase_23 AC 87 ms
76,604 KB
testcase_24 AC 106 ms
80,372 KB
testcase_25 AC 113 ms
81,336 KB
testcase_26 AC 101 ms
79,684 KB
testcase_27 AC 122 ms
84,492 KB
testcase_28 AC 162 ms
97,636 KB
testcase_29 AC 108 ms
79,020 KB
testcase_30 AC 134 ms
89,664 KB
testcase_31 AC 178 ms
103,448 KB
testcase_32 AC 240 ms
124,436 KB
testcase_33 AC 239 ms
124,704 KB
testcase_34 AC 254 ms
124,152 KB
testcase_35 AC 272 ms
124,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    H,W=map(int,input().split())

    print("Yes")

    X=[[0]*W for _ in range(H)]
    B=[]

    for i in range(H):
        for j in range(W):
            k=i*W+j+1
            if (i+j)%2==0:
                X[i][j]=k
            else:
                B.append(k)

    B.reverse()
    for i in range(H-1,-1,-1):
        for j in range(W-1,-1,-1):
            if X[i][j]==0:
                X[i][j]=B.pop()

    for i in range(H):
        print(*X[i])

#==================================================
solve()
0