結果
| 問題 |
No.2112 All 2x2 are Equal
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-28 22:24:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 62 ms / 2,000 ms |
| コード長 | 482 bytes |
| コンパイル時間 | 1,400 ms |
| コンパイル使用メモリ | 170,448 KB |
| 実行使用メモリ | 7,168 KB |
| 最終ジャッジ日時 | 2024-07-06 01:35:22 |
| 合計ジャッジ時間 | 6,197 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int h, w, c0 = 1, c1;
cin >> h >> w;
c1 = h * w;
cout << "Yes" << '\n';
vector<vector<int>> A(h, vector<int>(w));
for(int y = 0; y < h; y++){
for(int x = 0; x < w; x++){
if((y + x) & 1)A[y][x] = c1--;
else A[y][x] = c0++;
cout << A[y][x] << (x + 1 == w ? '\n' : ' ');
}
}
}