結果

問題 No.2112 All 2x2 are Equal
ユーザー ニックネームニックネーム
提出日時 2022-10-28 22:55:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 743 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 48,364 KB
最終ジャッジ日時 2023-09-20 06:07:36
合計ジャッジ時間 14,819 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,892 KB
testcase_01 AC 15 ms
7,836 KB
testcase_02 AC 36 ms
9,252 KB
testcase_03 AC 32 ms
9,084 KB
testcase_04 AC 310 ms
24,176 KB
testcase_05 AC 399 ms
29,088 KB
testcase_06 AC 686 ms
45,488 KB
testcase_07 AC 226 ms
19,856 KB
testcase_08 AC 554 ms
37,700 KB
testcase_09 AC 47 ms
9,924 KB
testcase_10 AC 263 ms
21,700 KB
testcase_11 AC 186 ms
17,280 KB
testcase_12 AC 213 ms
19,136 KB
testcase_13 AC 617 ms
41,076 KB
testcase_14 AC 41 ms
9,768 KB
testcase_15 AC 442 ms
31,544 KB
testcase_16 AC 16 ms
8,208 KB
testcase_17 AC 550 ms
37,672 KB
testcase_18 AC 29 ms
8,748 KB
testcase_19 AC 57 ms
10,468 KB
testcase_20 AC 31 ms
8,988 KB
testcase_21 AC 527 ms
36,276 KB
testcase_22 AC 41 ms
9,644 KB
testcase_23 AC 34 ms
9,100 KB
testcase_24 AC 75 ms
11,472 KB
testcase_25 AC 100 ms
12,788 KB
testcase_26 AC 73 ms
11,272 KB
testcase_27 AC 142 ms
15,104 KB
testcase_28 AC 333 ms
25,472 KB
testcase_29 AC 59 ms
10,708 KB
testcase_30 AC 225 ms
19,472 KB
testcase_31 AC 416 ms
30,044 KB
testcase_32 AC 743 ms
48,280 KB
testcase_33 AC 734 ms
48,272 KB
testcase_34 AC 740 ms
48,364 KB
testcase_35 AC 737 ms
48,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
ans = [[] for _ in range(h)]; p = 1; q = h*w
for i in range(h):
    if i%2:
        while True:
            ans[i].append(q); q -= 1
            if len(ans[i]) == w: break
            ans[i].append(p); p += 1
            if len(ans[i]) == w: break
    else:
        while True:
            ans[i].append(p); p += 1
            if len(ans[i]) == w: break
            ans[i].append(q); q -= 1
            if len(ans[i]) == w: break
print("Yes")
for s in ans: print(*s)
0