Submission #341616

# Submission time Handle Problem Language Result Execution time Memory
341616 2020-12-30T09:01:05 Z antin_kuntin Red-blue table (IZhO19_stones) C++17
0 / 100
38 ms 1516 KB
#include <bits/stdc++.h>

using namespace std;

#define st first
#define nd second
#define pb push_back
#define int long long int
#define endl '\n'
#define MOD (int)(1e9 + 7)
#define all(x) x.begin(), x.end()
#define mid start+(end-start)/2
#define debug(x) cerr << #x << " = " << x << endl
#define binary(x) cerr << #x << " = " << bitset<8>(x) << endl
#define N (int)(1e3)+5

int t,n,m;
char mat[N][N];

int32_t main(){
	ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0);
	cin >> t;
	for(int i = 0; i < t; i++){
		cin >> n >> m;
		int na = n, ma = m;
		if(ma >= na){
			for(int j = 1; j <= ma; j++){
				for(int k = 1; k <= na; k++){
					if(k <= ((ma+2)/2)) mat[j][k] = '-';
					else mat[j][k] = '+';
				}
			}
		}
		else{
			for(int j = 1; j <= na; j++){
				for(int k = 1; k <= ma; k++){
					if(k <= ((na+1)/2)) mat[k][j] = '+';
					else mat[k][j] = '-';
				}
			}
		}
		if(na > ma) swap(na, ma);
		cout << ma+na-((na+2)/2) << endl;
		for(int j = 1; j <= n; j++){
			for(int k = 1; k <= m; k++){
				cout << mat[k][j];
			}
			cout << endl;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 512 KB Output is correct
2 Incorrect 0 ms 364 KB in the table A+B is not equal to 5
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB in the table A+B is not equal to 46
# Verdict Execution time Memory Grader output
1 Correct 1 ms 512 KB Output is correct
2 Incorrect 0 ms 364 KB in the table A+B is not equal to 5
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 1516 KB in the table A+B is not equal to 107
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 1460 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 512 KB Output is correct
2 Incorrect 0 ms 364 KB in the table A+B is not equal to 5