Submission #1047975

# Submission time Handle Problem Language Result Execution time Memory
1047975 2024-08-07T19:17:58 Z TAhmed33 Red-blue table (IZhO19_stones) C++
0 / 100
1 ms 604 KB
#include <bits/stdc++.h>
using namespace std;
void solve () {
	int n, m; cin >> n >> m;
	if (n > m) {
		cout << n + (m + 1) / 2 << '\n';
		assert(n + (m + 1) / 2 == 108);
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				cout << (j & 1 ? "+" : "-");
			}
			cout << '\n';
		}
	} else {
		cout << m + (n + 1) / 2 << '\n';
		assert(m + (n + 1) / 2 == 108);
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j <= m; j++) {
				cout << (i & 1 ? "-" : "+");
			}
			cout << '\n';
		}
	}
}		
signed main () {
	ios::sync_with_stdio(0); cin.tie(0);
	int tc = 1; cin >> tc;
	while (tc--) solve();
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -