| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 238849 | arnold518 | Red-blue table (IZhO19_stones) | C++14 | 63 ms | 2272 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 1000;
int TC, N, M;
char S[MAXN+10][MAXN+10];
int main()
{
int i, j, k;
scanf("%d", &TC);
while(TC--)
{
scanf("%d%d", &N, &M);
int ans=0; pii t;
for(i=0; i<=N; i++)
{
for(j=0; j<=M; j++)
{
int x=min((M-1)/2, j);
int y=max(0, i-(N-1)/2);
if(x*i>=y*j) { if(ans<=i+j) ans=i+j, t={i, j}; }
}
}
for(i=0; i<N; i++) for(j=0; j<M; j++) S[i][j]='+';
int a=t.first, b=t.second;
int x=min((M-1)/2, b);
int y=max(0, a-(N-1)/2);
for(j=0, i=0; j<b; j++)
{
for(k=0; k<y; k++, i=(i+1)%a)
{
S[i][j]='-';
}
}
for(i=a; i<N; i++) for(j=0; j<b; j++) S[i][j]='-';
printf("%d\n", ans);
for(i=0; i<N; i++) { for(j=0; j<M; j++) printf("%c", S[i][j]); printf("\n"); }
}
}
컴파일 시 표준 에러 (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... | ||||
