Submission #490192

# Submission time Handle Problem Language Result Execution time Memory
490192 2021-11-26T07:38:31 Z Mr_Husanboy Red-blue table (IZhO19_stones) C++14
27 / 100
30 ms 1284 KB
// Muallif: Mansuraliyev Husanboy Murotali o'g'li  >> NamPS

#include<bits/stdc++.h>

using namespace std;
#define ios ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const double PI=3.1415926535897932384626433832795;
// 0-9 >> 48-57;    A-Z>>65-90   and   a-z>>97-122 respectively;



int main()
{
	int t; cin>>t;while(t--){
		int n,m;cin>>n>>m;
		int mx=max(n,m);
		int mn=min(n,m);
		if(mn%2==0) cout<<mx+(mn-1)/2<<"\n";else cout<<mx+mn/2<<"\n";
		if(m==mx){
			for(int i=0;i<n;i++){
				for(int j=0;j<m;j++){
					if(i<=n/2) cout<<"-";else cout<<"+";
				}
				cout<<"\n";
			}
		}else{
			for(int i=0;i<n;i++){
				for(int j=0;j<m;j++){
					if(j<=m/2) cout<<"+";else cout<<"-";
				}
				cout<<"\n";
			}
		}
		//cout<<endl;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 2 ms 204 KB Output is correct
4 Incorrect 3 ms 332 KB Wrong answer in test 5 29: 31 < 32
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 1284 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 1212 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 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 2 ms 204 KB Output is correct
4 Incorrect 3 ms 332 KB Wrong answer in test 5 29: 31 < 32