Submission #490577

# Submission time Handle Problem Language Result Execution time Memory
490577 2021-11-28T04:42:04 Z Ziyoda Red-blue table (IZhO19_stones) C++14
27 / 100
43 ms 1236 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	int t;
	cin >> t;
	while(t--){
		int n, m;
		cin >> n >> m;
		if(n<=m){
			int e = (n-1)/2, e1;
			cout << m+e << endl;
			e1=e;
			for(int i=0; i<n; i++){
				if(e1!=0){
					for(int j=0; j<m; j++)
						cout << '+';
					e1--;
				}
				else{
					for(int j=0; j<m; j++)
						cout << '-';
				}
				cout << endl;
			}
		}
		else{
			int e = (m-1)/2, e1;
			cout << n+e << endl;
			for(int i=0; i<n; i++){
				e1 = e;
				for(int j=0; j<m; j++){
					if(e1!=0){
						cout << '-';	e1--;	}
					else
						cout << '+';
				}
				cout << endl;
			}
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 312 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 312 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 5 ms 332 KB Output is correct
4 Incorrect 10 ms 332 KB Wrong answer in test 5 29: 31 < 32
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 1236 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 1200 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 312 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 5 ms 332 KB Output is correct
4 Incorrect 10 ms 332 KB Wrong answer in test 5 29: 31 < 32