結果

問題 No.2112 All 2x2 are Equal
ユーザー titiatitia
提出日時 2022-10-29 02:59:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 860 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 648 ms
コンパイル使用メモリ 10,904 KB
実行使用メモリ 47,660 KB
最終ジャッジ日時 2023-09-20 09:36:46
合計ジャッジ時間 15,698 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,920 KB
testcase_01 AC 16 ms
7,860 KB
testcase_02 AC 39 ms
9,324 KB
testcase_03 AC 34 ms
9,116 KB
testcase_04 AC 360 ms
24,316 KB
testcase_05 AC 459 ms
29,276 KB
testcase_06 AC 803 ms
44,952 KB
testcase_07 AC 271 ms
19,816 KB
testcase_08 AC 664 ms
37,812 KB
testcase_09 AC 51 ms
9,988 KB
testcase_10 AC 302 ms
21,676 KB
testcase_11 AC 214 ms
17,560 KB
testcase_12 AC 241 ms
19,044 KB
testcase_13 AC 713 ms
40,792 KB
testcase_14 AC 44 ms
9,712 KB
testcase_15 AC 513 ms
31,496 KB
testcase_16 AC 16 ms
8,256 KB
testcase_17 AC 633 ms
37,040 KB
testcase_18 AC 30 ms
8,784 KB
testcase_19 AC 61 ms
10,564 KB
testcase_20 AC 33 ms
9,088 KB
testcase_21 AC 607 ms
36,172 KB
testcase_22 AC 45 ms
9,604 KB
testcase_23 AC 35 ms
9,136 KB
testcase_24 AC 83 ms
11,564 KB
testcase_25 AC 109 ms
12,752 KB
testcase_26 AC 83 ms
11,488 KB
testcase_27 AC 159 ms
15,184 KB
testcase_28 AC 389 ms
25,460 KB
testcase_29 AC 65 ms
10,684 KB
testcase_30 AC 255 ms
19,672 KB
testcase_31 AC 487 ms
30,120 KB
testcase_32 AC 855 ms
47,604 KB
testcase_33 AC 858 ms
47,660 KB
testcase_34 AC 860 ms
47,616 KB
testcase_35 AC 857 ms
47,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W=map(int,input().split())

ANS=[[0]*W for i in range(H)]

now=1

for i in range(H):
    for j in range(W):
        if (i+j)%2==0:
            ANS[i][j]=now
            now+=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]=now
            now+=1

print("Yes")

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