제출 #286854

#제출 시각아이디문제언어결과실행 시간메모리
286854dvdg6566Red-blue table (IZhO19_stones)C++14
0 / 100
3 ms512 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector<ll> vi;
typedef vector<pi> vpi;
#define pb emplace_back
#define mp make_pair
#define f first
#define s second
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(),x.end()
#define lb lower_bound
const int MAXN=1001;
const ll MOD=998244353;

ll A[MAXN][MAXN];
ll R,C,T;

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>T;
	while(T--){
		cin>>R>>C;
		assert(R%2==1&&C%2==1);

		if(R==1){
			cout<<C<<'\n';
		}else if(C==1){
			cout<<R<<'\n';
			for(int i=0;i<R;++i){cout<<'+';cout<<'\n';}
			return 0;
		}else cout<<R+C-2<<'\n';

		for(int i=0;i<C;++i)cout<<'-';cout<<'\n';
		int h=C/2;
		for(int i=1;i<R;++i){
			if(i%2==1){
				for(int k=0;k<h;++k)cout<<'+';
				cout<<'+';
				for(int k=0;k<h;++k)cout<<'-';
			}else{
				for(int k=0;k<h;++k)cout<<'-';
				cout<<'+';
				for(int k=0;k<h;++k)cout<<'+';
			}
			cout<<'\n';
		}
		// return 0;
	}	
}

컴파일 시 표준 에러 (stderr) 메시지

stones.cpp: In function 'int main()':
stones.cpp:35:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   35 |   for(int i=0;i<C;++i)cout<<'-';cout<<'\n';
      |   ^~~
stones.cpp:35:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   35 |   for(int i=0;i<C;++i)cout<<'-';cout<<'\n';
      |                                 ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...