Submission #236441

# Submission time Handle Problem Language Result Execution time Memory
236441 2020-06-02T09:04:55 Z kshitij_sodani Red-blue table (IZhO19_stones) C++17
0 / 100
64 ms 1400 KB
#include <bits/stdc++.h>
using namespace std;
typedef int64_t llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
int n,m,t;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin>>t;
	while(t--){
		cin>>n>>m;
		if(n%2==1 and m%2==1){
			if(n>m){
				cout<<n+(m/2)<<endl;
				for(int i=0;i<n;i++){
					for(int j=0;j<m;j++){
						if(j%2==0){
							cout<<"+";
						}
						else{
							cout<<"-";
						}
					}
					cout<<endl;
				}
			}
			else{
				cout<<m+(n/2)<<endl;
				for(int i=0;i<n;i++){
					for(int j=0;j<m;j++){
						if(i%2==0){
							cout<<"-";
						}
						else{
							cout<<"+";
						}
					}
					cout<<endl;
				}

			}
		}
	}


	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 5 ms 384 KB invalid character
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 384 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 5 ms 384 KB invalid character
# Verdict Execution time Memory Grader output
1 Incorrect 64 ms 1400 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 892 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 5 ms 384 KB invalid character