結果

問題 No.2112 All 2x2 are Equal
ユーザー umezoumezo
提出日時 2022-10-28 23:39:07
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 663 bytes
コンパイル時間 2,315 ms
コンパイル使用メモリ 198,024 KB
実行使用メモリ 7,304 KB
最終ジャッジ日時 2023-09-20 06:57:40
合計ジャッジ時間 7,492 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 5 ms
4,380 KB
testcase_03 AC 4 ms
4,380 KB
testcase_04 AC 34 ms
6,548 KB
testcase_05 AC 43 ms
5,632 KB
testcase_06 AC 73 ms
7,160 KB
testcase_07 AC 25 ms
4,788 KB
testcase_08 AC 59 ms
7,272 KB
testcase_09 AC 5 ms
4,380 KB
testcase_10 AC 28 ms
5,596 KB
testcase_11 AC 20 ms
4,380 KB
testcase_12 AC 23 ms
5,656 KB
testcase_13 AC 65 ms
6,916 KB
testcase_14 AC 5 ms
4,376 KB
testcase_15 AC 48 ms
5,844 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 58 ms
6,680 KB
testcase_18 AC 3 ms
4,380 KB
testcase_19 AC 7 ms
4,828 KB
testcase_20 AC 5 ms
5,348 KB
testcase_21 AC 56 ms
6,452 KB
testcase_22 AC 5 ms
4,376 KB
testcase_23 AC 3 ms
4,380 KB
testcase_24 AC 10 ms
5,508 KB
testcase_25 AC 12 ms
4,836 KB
testcase_26 AC 8 ms
4,376 KB
testcase_27 AC 16 ms
5,148 KB
testcase_28 AC 36 ms
6,652 KB
testcase_29 AC 8 ms
6,800 KB
testcase_30 AC 24 ms
4,660 KB
testcase_31 AC 45 ms
7,112 KB
testcase_32 AC 77 ms
7,272 KB
testcase_33 AC 78 ms
7,300 KB
testcase_34 AC 78 ms
7,296 KB
testcase_35 AC 77 ms
7,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;

int G[1010][1010];
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int h,w;
  cin>>h>>w;
  cout<<"Yes"<<endl;
  
  int ni=0,nj=0;
  bool b=false;
  int now=1;
  rep(i,h) rep(j,w){
    if(i%2==0 && j%2==1) continue;
    if(i%2==1 && j%2==0) continue;
    G[i][j]=now;
    now++;
  }
  
  now=h*w;
  rep(i,h) rep(j,w){
    if(G[i][j]) continue;
    G[i][j]=now;
    now--;
  }
  
  rep(i,h){
    rep(j,w){
      if(j) cout<<" ";
      cout<<G[i][j];
    }
    cout<<'\n';
  }

  return 0;
}
0