結果

問題 No.2112 All 2x2 are Equal
ユーザー lloyzlloyz
提出日時 2022-10-31 00:02:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 916 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 743 ms
コンパイル使用メモリ 10,864 KB
実行使用メモリ 48,468 KB
最終ジャッジ日時 2023-09-21 21:28:26
合計ジャッジ時間 21,537 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,936 KB
testcase_01 AC 16 ms
7,944 KB
testcase_02 AC 40 ms
9,424 KB
testcase_03 AC 35 ms
9,124 KB
testcase_04 AC 364 ms
24,256 KB
testcase_05 AC 474 ms
29,300 KB
testcase_06 AC 832 ms
45,752 KB
testcase_07 AC 269 ms
19,968 KB
testcase_08 AC 675 ms
37,796 KB
testcase_09 AC 53 ms
9,952 KB
testcase_10 AC 309 ms
21,952 KB
testcase_11 AC 217 ms
17,360 KB
testcase_12 AC 251 ms
19,120 KB
testcase_13 AC 751 ms
41,168 KB
testcase_14 AC 45 ms
9,752 KB
testcase_15 AC 531 ms
31,712 KB
testcase_16 AC 17 ms
8,192 KB
testcase_17 AC 657 ms
37,872 KB
testcase_18 AC 30 ms
8,632 KB
testcase_19 AC 63 ms
10,664 KB
testcase_20 AC 34 ms
9,108 KB
testcase_21 AC 639 ms
36,588 KB
testcase_22 AC 46 ms
9,784 KB
testcase_23 AC 35 ms
9,112 KB
testcase_24 AC 82 ms
11,268 KB
testcase_25 AC 111 ms
12,676 KB
testcase_26 AC 82 ms
11,456 KB
testcase_27 AC 164 ms
15,448 KB
testcase_28 AC 388 ms
25,676 KB
testcase_29 AC 66 ms
10,608 KB
testcase_30 AC 258 ms
19,372 KB
testcase_31 AC 492 ms
30,232 KB
testcase_32 AC 916 ms
47,892 KB
testcase_33 AC 896 ms
48,280 KB
testcase_34 AC 888 ms
48,344 KB
testcase_35 AC 874 ms
48,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())

ANS = [[0 for _ in range(w)] for _ in range(h)]
curr = 1
for i in range(h):
    for j in range(w):
        if (i + j) % 2 == 0:
            ANS[i][j] = curr
            curr += 1
for i in range(h - 1, -1, -1):
    for j in range(w - 1, -1, -1):
        if (i + j) % 2 == 1:
            ANS[i][j] = curr
            curr += 1
print("Yes")
for i in range(h):
    print(*ANS[i])
0