結果

問題 No.2112 All 2x2 are Equal
ユーザー 沙耶花沙耶花
提出日時 2022-10-28 23:33:21
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 442 ms / 2,000 ms
コード長 746 bytes
コンパイル時間 4,734 ms
コンパイル使用メモリ 263,464 KB
実行使用メモリ 54,264 KB
最終ジャッジ日時 2023-09-20 06:50:40
合計ジャッジ時間 14,944 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 9 ms
4,468 KB
testcase_03 AC 7 ms
4,376 KB
testcase_04 AC 167 ms
23,744 KB
testcase_05 AC 202 ms
30,076 KB
testcase_06 AC 392 ms
50,652 KB
testcase_07 AC 114 ms
17,868 KB
testcase_08 AC 311 ms
41,604 KB
testcase_09 AC 15 ms
5,108 KB
testcase_10 AC 124 ms
20,568 KB
testcase_11 AC 89 ms
15,012 KB
testcase_12 AC 98 ms
16,800 KB
testcase_13 AC 349 ms
45,056 KB
testcase_14 AC 11 ms
4,936 KB
testcase_15 AC 232 ms
33,172 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 310 ms
40,204 KB
testcase_18 AC 7 ms
4,380 KB
testcase_19 AC 19 ms
6,052 KB
testcase_20 AC 8 ms
4,376 KB
testcase_21 AC 301 ms
38,984 KB
testcase_22 AC 11 ms
4,848 KB
testcase_23 AC 7 ms
4,380 KB
testcase_24 AC 27 ms
7,264 KB
testcase_25 AC 37 ms
8,868 KB
testcase_26 AC 26 ms
6,956 KB
testcase_27 AC 66 ms
11,756 KB
testcase_28 AC 180 ms
25,188 KB
testcase_29 AC 21 ms
6,048 KB
testcase_30 AC 105 ms
17,664 KB
testcase_31 AC 209 ms
31,436 KB
testcase_32 AC 403 ms
54,264 KB
testcase_33 AC 392 ms
53,732 KB
testcase_34 AC 442 ms
53,764 KB
testcase_35 AC 439 ms
53,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001




int main(){
	int h,w;
	cin>>h>>w;
	
	
	vector a(h,vector<int> (w));
	int cur = 0;
	rep(i,h){
		rep(j,w){
			if((i+j)%2==0){
				a[i][j] = cur;
				cur++;
			}
		}
	}
	for(int i=h-1;i>=0;i--){
		for(int j=w-1;j>=0;j--){
			if((i+j)%2==1){
				a[i][j] = cur;
				cur++;
			}
		}
	}
	cout<<"Yes"<<endl;
	rep(i,h){
		rep(j,w){
			if(j!=0)cout<<' ';
			cout<<a[i][j]+1;
		}
		cout<<endl;
	}
	set<int> s;
	rep(i,h){
		rep(j,w){
			s.insert(a[i][j]);
		}
	}
	
	//cout<<s.size()<<endl;
	
	return 0;
}
0