| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1357588 | ivaziva | Red-blue table (IZhO19_stones) | C++20 | 15 ms | 1332 KiB |
#include <bits/stdc++.h>
using namespace std;
#define MAXN 1001
#define int long long
int n,m,t;
char a[MAXN][MAXN];
int32_t main()
{
cin>>t;
for (int test=0;test<t;test++)
{
cin>>n>>m;
if (n<=m)
{
int targeta=(n+1)/2-1,numa=m/2+1;
for (int row=1;row<=targeta;row++)
{
for (int col=1;col<=m;col++)
{
if (col<=numa) a[row][col]='+';
else a[row][col]='-';
}
}
for (int row=targeta+1;row<=n;row++)
{
for (int col=1;col<=m;col++) a[row][col]='-';
}
}
else
{
int targetb=(m+1)/2-1,numb=n/2+1;
for (int col=1;col<=targetb;col++)
{
for (int row=1;row<=n;row++)
{
if (row<=numb) a[row][col]='-';
else a[row][col]='+';
}
}
for (int col=targetb+1;col<=m;col++)
{
for (int row=1;row<=n;row++) a[row][col]='+';
}
}
cout<<max(n,m)+(min(n,m)+1)/2-1<<endl;
for (int row=1;row<=n;row++)
{
for (int col=1;col<=m;col++) cout<<a[row][col];
cout<<endl;
}
}
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
