#include <bits/stdc++.h>
#define DIM 1010
using namespace std;
int t,n,m,i,j;
int a[DIM][DIM],sol[DIM][DIM];
int main (){
//ifstream cin ("date.in");
//ofstream cout ("date.out");
cin>>t;
for (;t--;){
cin>>n>>m;
if (n + (m-1)/2 > m + (n-1)/2){
cout<<n + (m-1)/2<<"\n";
for (i=1;i<=n;i++,cout<<"\n")
for (j=1;j<=m;j++){
if (j <= (m+2)/2)
cout<<"+";
else cout<<"-";
}
} else {
cout<<m + (n-1)/2<<"\n";
for (i=1;i<=n;i++,cout<<"\n")
for (j=1;j<=m;j++){
if (i <= (n+2)/2)
cout<<"-";
else cout<<"+";
}
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Incorrect |
4 ms |
364 KB |
Wrong answer in test 5 29: 31 < 32 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
43 ms |
1388 KB |
Wrong answer in test 97 21: 107 < 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
41 ms |
1516 KB |
Wrong answer in test 24 24: 35 < 44 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Incorrect |
4 ms |
364 KB |
Wrong answer in test 5 29: 31 < 32 |