Submission #498586

# Submission time Handle Problem Language Result Execution time Memory
498586 2021-12-25T15:11:11 Z The_Samurai Red-blue table (IZhO19_stones) C++
0 / 100
56 ms 1608 KB
#include <bits/stdc++.h>
 
using namespace std;

/*

6 6
++++--
++++--
------
------
--++++
--++++
8 8
+++++---
+++++---
+++++---
--------
--------
---+++++
---+++++
---+++++
7 7
++++---
++++---
++++---
---+---
---++++
---++++
---++++


*/

void solve() {
	int n, m;
	
	cin >> n >> m;
	if (n == 1) {
		cout << "1\n+\n";
		return;
	}
	if (n == 2) {
		cout << "2\n++\n++\n";
		return;
	}
	if (n % 2 == 1) {
		cout << 2 * n - 2;
	}
	else {
		cout << 2 * n - 4;
	}
	cout << '\n';
	for (int i = 0; i < (n - 1) / 2; i++) {
		for (int j = 0; j < n / 2 + 1; j++) {
			cout << '+';
		}
		for (int j = n / 2 + 1; j < n; j++) {
			cout << '-';
		}
		cout << '\n';
	}
	for (int i = 0; i < 2 - n % 2; i++) {
		for (int j = 0; j < n; j++) {
			cout << '-';
		}
		cout << '\n';
	}
	for (int i = 0; i < (n - 1) / 2; i++) {
		for (int j = 0; j < (n - 1) / 2; j++) {
			cout << '-';
		}
		for (int j = (n - 1) / 2; j < n; j++) {
			cout << '+';
		}
		cout << '\n';
	}
}
 
int main() {
	int t;
	
	cin >> t;
	while (t--) {
		solve();
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 384 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 56 ms 1608 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 1220 KB Wrong answer in test 4 4: 4 < 5
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Wrong answer
2 Halted 0 ms 0 KB -