Submission #499702

# Submission time Handle Problem Language Result Execution time Memory
499702 2021-12-29T09:30:34 Z sireanu_vlad Red-blue table (IZhO19_stones) C++14
27 / 100
4 ms 1228 KB
#include <iostream>
#include <cstring>
using namespace std;

void solve(int n, int m)
{
	cout << (m + (n-1)/2) << '\n';
	for(int i = 0; i < n; ++i)
		cout << (i <= n/2 ? string(m, '-') : string(m, '+')) << '\n';
}

void solve2(int n, int m)
{
	cout << (n + (m-1)/2) << '\n';
	for(int i = 0; i < n; ++i)
		cout << string(m/2 + 1, '+') << string((m-1)/2, '-') << '\n';
}

int main()
{
	int t, n, m;
	cin >> t;
	while(t--)
	{
		cin >> n >> m;
		if(n < m) solve(n, m);
		else solve2(n, m);
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 288 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 288 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Incorrect 2 ms 332 KB Wrong answer in test 5 29: 31 < 32
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1228 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1228 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 288 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Incorrect 2 ms 332 KB Wrong answer in test 5 29: 31 < 32