Submission #167713

# Submission time Handle Problem Language Result Execution time Memory
167713 2019-12-09T18:33:17 Z munhorgil Red-blue table (IZhO19_stones) C++14
0 / 100
92 ms 1368 KB
#include<bits/stdc++.h>

using namespace std;

int main()
{
	int t , i , j , m , n , ans , a , b;
	
	cin >> t;
	
	while(t > 0)
	{
		cin >> n >> m;
		
		if(n % 2 == 0) a = n - 2;
			else a = n - 1;
		if(m % 2 == 0) b = m - 2;
			else b = m - 1;
		
		ans = a + b;
		
		cout << ans << endl;
		
		for(j = 0 ; j < a / 2 ; j++)
		{
			for(i = 0 ; i < b / 2 ; i++)
			{
				cout << "+";
			}
			for(i = 0 ; i < b / 2 ; i++)
			{
				cout << "-";
			}
			for(i = 0 ; i < (m - b) ; i++)
			{
				cout << "+";
			}
			cout << endl;
		}
		for(j = 0 ; j < a / 2 ; j++)
		{
			for(i = 0 ; i < b / 2 ; i++)
			{
				cout << "-";
			}
			for(i = 0 ; i < b / 2 ; i++)
			{
				cout << "+";
			}
			for(i = 0 ; i < (m - b) ; i++)
			{
				cout << "+";
			}
			cout << endl;
		}
		for(j = 0 ; j < (n - a) ; j++)
		{
			for(i = 0 ; i < m ; i++)
			{
				cout << "-";
			}
			cout << endl;
		}
		
		t--;
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB in the table A+B is not equal to 2
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 376 KB in the table A+B is not equal to 0
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB in the table A+B is not equal to 2
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 92 ms 1368 KB in the table A+B is not equal to 76
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 71 ms 1272 KB in the table A+B is not equal to 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB in the table A+B is not equal to 2
2 Halted 0 ms 0 KB -