結果

問題 No.2112 All 2x2 are Equal
ユーザー titiatitia
提出日時 2022-10-29 02:44:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 587 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 10,876 KB
実行使用メモリ 47,684 KB
最終ジャッジ日時 2023-09-20 09:24:05
合計ジャッジ時間 16,431 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
7,872 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 370 ms
24,208 KB
testcase_05 WA -
testcase_06 AC 828 ms
45,004 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 54 ms
10,016 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 251 ms
19,092 KB
testcase_13 AC 741 ms
40,872 KB
testcase_14 AC 46 ms
9,644 KB
testcase_15 AC 524 ms
31,668 KB
testcase_16 AC 16 ms
8,264 KB
testcase_17 WA -
testcase_18 AC 31 ms
9,052 KB
testcase_19 WA -
testcase_20 AC 34 ms
9,096 KB
testcase_21 AC 635 ms
36,168 KB
testcase_22 AC 46 ms
9,624 KB
testcase_23 AC 35 ms
9,212 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 84 ms
11,396 KB
testcase_27 AC 164 ms
15,200 KB
testcase_28 AC 400 ms
25,372 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 894 ms
47,668 KB
testcase_33 WA -
testcase_34 AC 888 ms
47,472 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

now=1

for i in range(0,H,2):
    for j in range(0,W,2):
        ANS[i][j]=now
        now+=1

for i in range(H-1,-1,-1):
    for j in range(W):
        if i%2==0 and j%2==1:
            ANS[i][j]=now
            now+=1

for i in range(1,H,2):
    for j in range(W-1,-1,-1):
        if j%2==1:
            ANS[i][j]=now
            now+=1

for i in range(H-1,-1,-1):
    for j in range(W-1,-1,-1):
        if i%2==1 and j%2==0:
            ANS[i][j]=now
            now+=1

print("Yes")

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