#include<bits/stdc++.h>
#define endl "\n"
using namespace std;
void speed()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
int t,n,m;
char a1,a2,h;
string s[1005];
void resh()
{
for(int i=1;i<=(n-1)/2;i++)
{
for(int j=1;j<=m/2+1;j++)
{
s[i][j]=a1;
}
for(int j=m/2+2;j<=m;j++)
{
s[i][j]=a2;
}
}
for(int i=(n-1)/2+1;i<=n;i++)
{
for(int j=1;j<=(m-1)/2;j++)
{
s[i][j]=a2;
}
for(int j=(m-1)/2+1;j<=m;j++)
{
s[i][j]=a1;
}
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
cout<<s[i][j]<<" ";
}
cout<<endl;
}
}
void read()
{
cin>>t;
for(int z=1;z<=t;z++)
{
cin>>n>>m;
if(n<m)
{
swap(n,m);
a1='-';
a2='+';
h=1;
}
else
{
a1='+';
a2='-';
}
resh();
}
}
int main()
{
speed();
read();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Expected integer, but "-" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Expected integer, but "-" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Expected integer, but "-" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Expected integer, but "-" found |
2 |
Halted |
0 ms |
0 KB |
- |