Submission #167019

# Submission time Handle Problem Language Result Execution time Memory
167019 2019-12-05T09:26:11 Z tselmegkh Red-blue table (IZhO19_stones) C++14
0 / 100
47 ms 1400 KB
#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 time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong answer in test 1 3: 2 < 3
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 376 KB Wrong answer in test 3 45: 25 < 46
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong answer in test 1 3: 2 < 3
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 46 ms 1400 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 47 ms 1400 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong answer in test 1 3: 2 < 3
2 Halted 0 ms 0 KB -