結果

問題 No.2112 All 2x2 are Equal
ユーザー HIcoderHIcoder
提出日時 2023-07-13 16:14:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 836 bytes
コンパイル時間 1,242 ms
コンパイル使用メモリ 111,772 KB
実行使用メモリ 7,564 KB
最終ジャッジ日時 2023-10-13 05:16:21
合計ジャッジ時間 11,094 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 4 ms
4,348 KB
testcase_03 AC 4 ms
4,348 KB
testcase_04 AC 32 ms
5,024 KB
testcase_05 AC 42 ms
5,548 KB
testcase_06 AC 71 ms
6,996 KB
testcase_07 AC 24 ms
4,548 KB
testcase_08 AC 57 ms
6,288 KB
testcase_09 AC 5 ms
4,352 KB
testcase_10 AC 26 ms
4,648 KB
testcase_11 AC 19 ms
4,372 KB
testcase_12 AC 22 ms
4,372 KB
testcase_13 AC 63 ms
6,608 KB
testcase_14 AC 5 ms
4,352 KB
testcase_15 AC 46 ms
5,680 KB
testcase_16 AC 2 ms
4,356 KB
testcase_17 AC 57 ms
6,236 KB
testcase_18 AC 3 ms
4,372 KB
testcase_19 AC 6 ms
4,352 KB
testcase_20 AC 3 ms
4,348 KB
testcase_21 AC 54 ms
6,088 KB
testcase_22 AC 4 ms
4,348 KB
testcase_23 AC 3 ms
4,348 KB
testcase_24 AC 8 ms
4,352 KB
testcase_25 AC 10 ms
4,352 KB
testcase_26 AC 8 ms
4,348 KB
testcase_27 AC 15 ms
4,352 KB
testcase_28 AC 34 ms
5,100 KB
testcase_29 AC 6 ms
4,356 KB
testcase_30 AC 23 ms
4,580 KB
testcase_31 AC 43 ms
5,504 KB
testcase_32 AC 75 ms
7,564 KB
testcase_33 AC 75 ms
7,328 KB
testcase_34 AC 75 ms
7,244 KB
testcase_35 AC 76 ms
7,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<set>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<numeric>
#include<queue>
#include<cmath>
#include <unordered_set>
using namespace std;
typedef long long ll;
const ll INF=1LL<<60;
typedef pair<int,int> P;
typedef pair<int,P> PP;
const ll MOD=998244353;
int main(){
    int H,W;
    cin>>H>>W;

    vector<vector<int>> ans(H,vector<int>(W,0));

    int c1=0,c2=0;

    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if((i+j)%2==0){
                c1++;
                ans[i][j]=c1;
            }else{
                c2++;
                ans[i][j]=H*W+1-c2;
            }
        }
    }
    
    cout<<"Yes"<<endl;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cout<<ans[i][j]<<(j==W-1?'\n':' ');
        }   
    }


}
0