結果

問題 No.2112 All 2x2 are Equal
ユーザー noshi91noshi91
提出日時 2022-10-28 23:26:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 670 bytes
コンパイル時間 1,144 ms
コンパイル使用メモリ 82,956 KB
実行使用メモリ 7,496 KB
最終ジャッジ日時 2023-09-20 06:43:22
合計ジャッジ時間 6,593 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 4 ms
4,380 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 33 ms
4,984 KB
testcase_05 AC 44 ms
5,660 KB
testcase_06 AC 78 ms
7,088 KB
testcase_07 AC 24 ms
4,516 KB
testcase_08 AC 60 ms
6,348 KB
testcase_09 AC 6 ms
4,376 KB
testcase_10 AC 28 ms
4,708 KB
testcase_11 AC 20 ms
4,376 KB
testcase_12 AC 23 ms
4,464 KB
testcase_13 AC 68 ms
6,828 KB
testcase_14 AC 4 ms
4,380 KB
testcase_15 AC 49 ms
5,712 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 59 ms
6,264 KB
testcase_18 AC 3 ms
4,380 KB
testcase_19 AC 6 ms
4,376 KB
testcase_20 AC 4 ms
4,376 KB
testcase_21 AC 57 ms
6,208 KB
testcase_22 AC 4 ms
4,376 KB
testcase_23 AC 3 ms
4,384 KB
testcase_24 AC 8 ms
4,376 KB
testcase_25 AC 11 ms
4,380 KB
testcase_26 AC 8 ms
4,380 KB
testcase_27 AC 15 ms
4,380 KB
testcase_28 AC 36 ms
5,184 KB
testcase_29 AC 6 ms
4,380 KB
testcase_30 AC 24 ms
4,588 KB
testcase_31 AC 46 ms
5,604 KB
testcase_32 AC 82 ms
7,440 KB
testcase_33 AC 81 ms
7,436 KB
testcase_34 AC 82 ms
7,496 KB
testcase_35 AC 82 ms
7,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/modint>

using mint = atcoder::modint998244353;

#include <iostream>
#include<vector>
#include<utility>
#include<algorithm>

int main() {

  int H, W;
  std::cin >> H >> W;

  std::vector a(H, std::vector<int>(W));

  for (int i = 0; i < H * W; i++) {
    a[i / W][i % W] = i + 1;
  }

  for (int r = 1; r < H; r += 2) {
    std::reverse(a[r].begin(), a[r].end());
  }

  for (int c = 1; c < W; c += 2) {
    for (int r = 0; r < H - r - 1; r++) {
      std::swap(a[r][c], a[H - r - 1][c]);
    }
  }

  std::cout << "Yes\n";
  for (auto& r : a) {
    for (int i = 0; i < W; i++) {
      std::cout << r[i] << " \n"[i + 1 == W];
    }
  }

  return 0;
}
0