結果
問題 | No.2112 All 2x2 are Equal |
ユーザー |
|
提出日時 | 2022-10-28 22:23:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 455 bytes |
コンパイル時間 | 1,669 ms |
コンパイル使用メモリ | 172,184 KB |
実行使用メモリ | 7,168 KB |
最終ジャッジ日時 | 2024-07-06 01:34:29 |
合計ジャッジ時間 | 4,699 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 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; 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' : ' '); } } }