이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int t;
cin>>t;
while(t--)
{
int a,b;
cin>>a>>b;
if(a==1||b==1)
{
cout<<max(a,b)<<"\n";
if(a==1)
{
cout<<"---\n";
}
else
{
cout<<"+\n+\n+\n";
}
continue;
}
if(a!=2&&b!=2) cout<<max(a,b)+1<<"\n";
else cout<<max(a,b)<<"\n";
if(max(a,b)==b)
{
for(int c=0;c<a;c++)
{
if(c!=a-1||a==2)
{
for(int i=0;i<b;i++)
{
cout<<"-";
}
}
else
{
for(int i=0;i<b;i++)
{
cout<<"+";
}
}
cout<<"\n";
}
}
else
{for(int c=0;c<a;c++)
{
for(int i=0;i<b;i++)
{
if(i==0&&b>2)
{
cout<<"-";
}
else
{
cout<<"+";
}
}
cout<<"\n";
}
}
}
}
# | 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... |