結果

問題 No.2112 All 2x2 are Equal
ユーザー roarisroaris
提出日時 2022-10-28 22:05:34
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 328 ms / 2,000 ms
コード長 543 bytes
コンパイル時間 1,734 ms
コンパイル使用メモリ 86,764 KB
実行使用メモリ 86,196 KB
最終ジャッジ日時 2023-09-20 05:04:11
合計ジャッジ時間 11,308 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
71,412 KB
testcase_01 AC 97 ms
71,456 KB
testcase_02 AC 114 ms
77,776 KB
testcase_03 AC 112 ms
77,676 KB
testcase_04 AC 167 ms
81,236 KB
testcase_05 AC 176 ms
82,252 KB
testcase_06 AC 228 ms
85,548 KB
testcase_07 AC 153 ms
80,228 KB
testcase_08 AC 205 ms
84,440 KB
testcase_09 AC 131 ms
77,680 KB
testcase_10 AC 155 ms
80,580 KB
testcase_11 AC 142 ms
79,544 KB
testcase_12 AC 149 ms
79,648 KB
testcase_13 AC 217 ms
84,692 KB
testcase_14 AC 121 ms
77,932 KB
testcase_15 AC 189 ms
82,780 KB
testcase_16 AC 108 ms
77,696 KB
testcase_17 AC 203 ms
84,300 KB
testcase_18 AC 113 ms
77,540 KB
testcase_19 AC 121 ms
78,044 KB
testcase_20 AC 117 ms
77,608 KB
testcase_21 AC 201 ms
83,812 KB
testcase_22 AC 121 ms
77,560 KB
testcase_23 AC 116 ms
77,716 KB
testcase_24 AC 124 ms
78,304 KB
testcase_25 AC 125 ms
78,748 KB
testcase_26 AC 120 ms
78,408 KB
testcase_27 AC 134 ms
78,916 KB
testcase_28 AC 169 ms
81,364 KB
testcase_29 AC 130 ms
78,244 KB
testcase_30 AC 149 ms
79,784 KB
testcase_31 AC 184 ms
82,320 KB
testcase_32 AC 237 ms
86,196 KB
testcase_33 AC 280 ms
85,996 KB
testcase_34 AC 242 ms
85,844 KB
testcase_35 AC 328 ms
86,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

H, W = map(int, input().split())
A = [[-1]*W for _ in range(H)]

for i in range(H):
    for j in range(W):
        A[i][j] = W*i+j+1

for i in range(1, H, 2):
    A[i].reverse()

for i in range(1, W, 2):
    for j in range(H//2):
        A[j][i], A[H-1-j][i] = A[H-1-j][i], A[j][i]

print('Yes')

for i in range(H):
    print(*A[i])
    
# for i in range(H-1):
#     for j in range(W-1):
#         assert(A[i][j]+A[i+1][j]+A[i][j+1]+A[i+1][j+1]==A[0][0]+A[0][1]+A[1][0]+A[1][1])
0