#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector<ll> vi;
typedef vector<pi> vpi;
#define pb emplace_back
#define mp make_pair
#define f first
#define s second
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(),x.end()
#define lb lower_bound
const int MAXN=1001;
const ll MOD=998244353;
ll A[MAXN][MAXN];
ll R,C,T;
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>T;
while(T--){
cin>>R>>C;
int ta=R+(C-1)/2;
int tb=C+(R-1)/2;
if(ta>=tb){
for(int col=0;col<C;++col){
int v=col%2;
for(int i=0;i<R;++i)A[i][col]=v;
}
}else{
for(int row=0;row<R;++row){
int v=row%2^1;
for(int i=0;i<C;++i)A[row][i]=v;
}
}
cout<<max(ta,tb)<<'\n';
for(int i=0;i<R;++i){
for(int j=0;j<C;++j){
if(A[i][j])cout<<'-';
else cout<<'+';
}
cout<<'\n';
}
// return 0;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
in the table A+B is not equal to 4 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
512 KB |
in the table A+B is not equal to 20 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
in the table A+B is not equal to 4 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
32 ms |
1784 KB |
Wrong answer in test 97 21: 107 < 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
31 ms |
2076 KB |
in the table A+B is not equal to 35 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
in the table A+B is not equal to 4 |