Submission #856736

# Submission time Handle Problem Language Result Execution time Memory
856736 2023-10-04T12:05:07 Z Halym2007 Red-blue table (IZhO19_stones) C++11
0 / 100
43 ms 1364 KB
#include <bits/stdc++.h>
using namespace std;
int a,b,c,d,t;

int main(){
	cin>>t;
	while(t--){
		cin>>a>>b;
		if(a < 3 or b < 3)	cout<<max(a, b)<<endl << "*" << endl;
		if(a >= 3 and b >= 3){
			if(a == b)	cout<<a + b - 2;
			else{
				if(max(a, b) % min(a, b) == 0)	cout<<max(a, b) - (max(a, b) - min(a, b));
				else	cout<<max(a, b) - (max(a, b) - min(a, b)) + 1;
			}
			cout<<endl;
			for(int i=1; i <= (a / 2); i++){
				for(int j=1; j <= b; j++){
					if(j <= ((b / 2) + 1))	cout<<"+";
					else	cout<<"-";
				}
				cout<<endl;
			}
			for(int i=1; i <= 1; i++){
				for(int j=1; j <= b; j++){
					if(j == ((b / 2) + 1))	cout<<"+";
					else	cout<<"-";
				}
			}
			cout<<endl;
			for(int i=1; i <= (a / 2); i++){
				for(int j=1; j <= b; j++){
					if(j >= ((b / 2) + 1))	cout<<"+";
					else	cout<<"-";
				}
				cout<<endl;
			}
		}
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 348 KB in the table A+B is not equal to 3
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 1364 KB in the table A+B is not equal to 22
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 1240 KB in the table A+B is not equal to 46
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong answer
2 Halted 0 ms 0 KB -