Submission #340786

# Submission time Handle Problem Language Result Execution time Memory
340786 2020-12-28T11:05:22 Z NachoLibre Red-blue table (IZhO19_stones) C++14
11 / 100
36 ms 1388 KB
#include <bits/stdc++.h>
using namespace std;

int t, n, m;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> t;
	for(int ti = 1; ti <= t; ++ti) {
		cin >> n >> m;
		if(n == 1) {
			cout << m << "\n";
			for(int i = 1; i <= m; ++i) {
				cout << "-";
			}
			cout << "\n";
		} else if(m == 1) {
			cout << n << "\n";
			for(int i = 1; i <= n; ++i) {
				cout << "+";
				cout << "\n";
			}
		} else {
			int ns = (n - 1) / 2 * 2, ms = (m - 1) / 2 * 2;
			cout << ns + ms << "\n";
			for(int i = 1; i <= n; ++i) {
				for(int j = 1; j <= m; ++j) {
					if(i > ns) {
						cout << "-";
					} else if(j > ms) {
						cout << "+";
					} else {
						cout << (((i + j) & 1) ? "-" : "+");
					}
				}
				cout << "\n";
			}
		}
		#ifdef WEEE
		cout << flush;
		#endif
	}
	cout << flush;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB in the table A+B is not equal to 2
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 492 KB Wrong answer in test 20 2: 18 < 20
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB in the table A+B is not equal to 2
# Verdict Execution time Memory Grader output
1 Correct 36 ms 1328 KB Output is correct
2 Correct 32 ms 1260 KB Output is correct
3 Correct 30 ms 1260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 1388 KB in the table A+B is not equal to 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB in the table A+B is not equal to 2