Submission #899161

# Submission time Handle Problem Language Result Execution time Memory
899161 2024-01-05T14:28:07 Z giorgitsibadze Red-blue table (IZhO19_stones) C++14
0 / 100
24 ms 1372 KB
#include <bits/stdc++.h>
using namespace std;

void solve() {
	int n, m;
	cin >> n >> m;
	char a[n + 1][m + 1];
	if(n == 1) {
	    for(int i = 1; i <= m; i++)cout << '-';
	    cout << '\n';
	    return;
	}
	for(int i = 1; i <= n; i++) {
		for(int j = 1; j <= m; j++) {
			if(j % 2 == 1) {
				a[i][j] = '+';
			}
			else a[i][j] = '-';
			if(m % 2 == 0 and j == m)a[i][j] = '+';
		}
	}
	int ans = n + m / 2;
	if(m % 2 == 0)ans--;
	cout << ans << '\n';
	for(int i = 1; i <= n; i++) {
		for(int j = 1; j <= m; j++) {
			cout << a[i][j];
		}
		cout << '\n';
	}
}

int main() {
	int t;
	cin >> t;
	while(t--) {
		solve();
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Expected integer, but "---" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB Wrong answer in test 3 45: 25 < 46
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Expected integer, but "---" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 1372 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 1372 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Expected integer, but "---" found
2 Halted 0 ms 0 KB -