이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
void test(int n, int m)
{
int sum = 0;
if(n >= m)
{
sum = n + m / 2 + m % 2 - 1;
}
else
{
sum = m + n / 2 + n % 2 - 1;
}
cout<<sum<<endl;
for(int row = 0;row < n;row++)
{
for(int col = 0;col < m;col++)
{
if(n >= m)
{
if(col < m / 2 + m % 2 - 1)
{
cout<<"-";
}
else
{
cout<<"+";
}
}
else
{
if(row < n / 2 + n % 2 - 1)
{
cout<<"+";
}
else
{
cout<<"-";
}
}
}
cout<<endl;
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
for(int i = 0;i < t;i++)
{
int n,m;
cin>>n>>m;
test(n,m);
}
return 0;
}
# | 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... |