제출 #167019

#제출 시각아이디문제언어결과실행 시간메모리
167019tselmegkhRed-blue table (IZhO19_stones)C++14
0 / 100
47 ms1400 KiB
#include<bits/stdc++.h>
using namespace std;

void solve(){
	int n, m;
	cin >> n >> m;
	char table[n][m];
	int ans = n + (m - (m / 2 + 1));
	for(int i = 0; i < n / 2 + 1; i++){
		for(int j = 0; j < m / 2 + 1; j++){
			table[i][j] = '+';
		}
		for(int j = m / 2 + 1; j < m; j++){
			table[i][j] = '-';
		}
	}
	for(int i = n / 2 + 1; i < n; i++){
		for(int j = 0; j < m; j++){
			table[i][j] = '+';
		}
	}
	cout << ans << '\n';
	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
			cout << table[i][j];
		}
		cout << '\n';
	}
}
int main(){
	int t;
	cin >> t;
	while(t--){
		solve();
	}
}
#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...