結果
| 問題 | No.2112 All 2x2 are Equal | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-10-29 01:04:33 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 68 ms / 2,000 ms | 
| コード長 | 553 bytes | 
| コンパイル時間 | 2,044 ms | 
| コンパイル使用メモリ | 193,564 KB | 
| 最終ジャッジ日時 | 2025-02-08 15:35:13 | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 34 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#ifdef _RUTHEN
#include <debug.hpp>
#else
#define show(...) true
#endif
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
template <class T> using V = vector<T>;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int H, W;
    cin >> H >> W;
    cout << "Yes\n";
    auto f = [&](int i, int j) -> int { return (i % 2 == 0 ? i * W + j + 1 : i * W + W - j); };
    rep(i, H) rep(j, W) cout << (j % 2 == 1 ? f(H - 1 - i, j) : f(i, j)) << " \n"[j == W - 1];
    return 0;
}
            
            
            
        