# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1183791 | asdfghjk | Red-blue table (IZhO19_stones) | C++20 | 13 ms | 1352 KiB |
#include <bits/stdc++.h>
#define pb push_back
#define all(x) x.begin(), x.end()
#define F first
#define S second
#define con continue
using namespace std;
typedef long long ll;
typedef double db;
typedef long double ld;
const ll N = 1000 + 5;
const ll inf = 1e9;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
int a[N][N];
void solve(){
int n,m;cin >> n >> m;
int res = max(n,m) + ((min(n,m) - 1) / 2);
cout << res << '\n';
if(n < m){
int q = ((n - 1) / 2);
for(int i = 1;i <= n;i++){
for(int j = 1;j <= m;j++){
if(i + q <= n){
cout << '-';
}
else cout << '+';
}
cout << '\n';
}
}
else{
int q = ((m - 1) / 2);
for(int i = 1;i <= n;i++){
for(int j = 1;j <= m;j++){
if(j + q <= m){
cout << '+';
}
else cout << '-';
}
cout << '\n';
}
}
}
main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int t;cin >> t;
while(t--){
solve();
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |