結果

問題 No.2112 All 2x2 are Equal
ユーザー HaaHaa
提出日時 2022-10-28 21:57:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 787 bytes
コンパイル時間 1,578 ms
コンパイル使用メモリ 171,540 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-07-06 01:04:20
合計ジャッジ時間 6,327 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
template<typename T> bool chmax(T &x, const T &y) {return (x<y)?(x=y,true):false;};
template<typename T> bool chmin(T &x, const T &y) {return (x>y)?(x=y,true):false;};
constexpr ll MOD=998244353;
constexpr ll INF=2e18;

int main(){
    int h, w; cin >> h >> w;
    VVI ans(h+1,VI(w));
    int l=1, r=h*w;
    REP(i,(h+1)/2){
        REP(j,w){
            int x=j%2==1;
            int y=j%2==0;
            ans[i*2+x][j]=l++;
            ans[i*2+y][j]=r--;
        }
    }
    cout << "Yes" << endl;
    REP(i,h)REP(j,w) cout << ans[i][j] << " \n"[j==w-1];
    return 0;
}
0