# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
218315 | Lawliet | Red-blue table (IZhO19_stones) | C++17 | 53 ms | 1528 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
int n, m;
char ans[MAXN][MAXN];
char aux[MAXN][MAXN];
int main()
{
int t;
scanf("%d",&t);
for(int k = 0 ; k < t ; k++)
{
scanf("%d %d",&n,&m);
bool wasSwaped = false;
if( n > m )
{
swap( n , m );
wasSwaped = true;
}
printf("%d\n",n + m - (n + 2)/2);
for(int i = 1 ; i <= n - (n + 2)/2 ; i++)
for(int j = 1 ; j <= m ; j++)
ans[i][j] = '+';
for(int i = n - (n + 2)/2 + 1 ; i <= n ; i++)
for(int j = 1 ; j <= m ; j++)
ans[i][j] = '-';
if( wasSwaped )
{
for(int i = 1 ; i <= n ; i++)
for(int j = 1 ; j <= m ; j++)
aux[i][j] = ans[i][j];
for(int i = 1 ; i <= m ; i++)
for(int j = 1 ; j <= n ; j++)
ans[i][j] = '+' + '-' - aux[j][i];
swap( n , m );
}
for(int i = 1 ; i <= n ; i++, printf("\n"))
for(int j = 1 ; j <= m ; j++)
printf("%c",ans[i][j]);
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |