結果

問題 No.2112 All 2x2 are Equal
ユーザー tamatotamato
提出日時 2022-10-28 22:30:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 633 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 86,912 KB
実行使用メモリ 86,008 KB
最終ジャッジ日時 2023-09-20 05:36:01
合計ジャッジ時間 10,498 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,384 KB
testcase_01 AC 72 ms
71,084 KB
testcase_02 AC 90 ms
76,580 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 200 ms
84,948 KB
testcase_07 AC 128 ms
79,808 KB
testcase_08 AC 181 ms
83,704 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 122 ms
79,172 KB
testcase_12 WA -
testcase_13 AC 196 ms
84,284 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 180 ms
83,176 KB
testcase_18 AC 90 ms
76,460 KB
testcase_19 AC 99 ms
78,036 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 88 ms
76,424 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 100 ms
77,576 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 103 ms
77,508 KB
testcase_30 AC 126 ms
79,412 KB
testcase_31 AC 158 ms
81,292 KB
testcase_32 AC 235 ms
85,432 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 222 ms
85,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353


def main():
    import sys
    input = sys.stdin.readline

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

    print("Yes")
    ans = [[0] * W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if (h + w) & 1:
                ans[h][w] = H * W - (h * W + w)
            else:
                ans[h][w] = h * W + w + 1
    for h in range(H):
        print(*ans[h])

    S = ans[0][0] + ans[0][1] + ans[1][0] + ans[1][1]
    for h in range(H - 1):
        for w in range(W - 1):
            assert ans[h][w] + ans[h+1][w] + ans[h][w+1] + ans[h+1][w+1] == S


if __name__ == '__main__':
    main()
0