結果

問題 No.2112 All 2x2 are Equal
ユーザー みここ
提出日時 2022-12-11 21:53:15
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 576 ms
コンパイル使用メモリ 66,408 KB
最終ジャッジ日時 2025-02-09 09:46:40
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main()
{
    int h, w;
    cin >> h >> w;
    cout << "Yes" << endl;
    int l = 0, r = h * w;
    for(int i = 0; i < h; i++)
    {
        for(int j = 0; j < w; j++)
        {
            cout << ((i + j) % 2 ? ++l : r--) << " ";
        }
        cout << endl;
    }
}
0