| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 286843 | tqbfjotld | Red-blue table (IZhO19_stones) | C++14 | 49 ms | 1360 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main(){
int T;
scanf("%d",&T);
for (int t = 0; t<T; t++){
int a,b;
scanf("%d%d",&a,&b);
int besta = 0, bestb = b;
int reqa = b/2+1;
int reqb = (a-1)/2;
int curb = b;
for (int x = 1; x<=a; x++){
while (x*(reqa-(b-curb))>reqb*curb){
curb--;
}
if (x+curb>besta+bestb){
besta = x;
bestb = curb;
}
}
printf("%d\n",besta+bestb);
int curC = b-bestb;
for (int y = 0; y<besta; y++){
int cn = reqa-(b-bestb);
for (int x = 0; x<b; x++){
if (x<b-bestb){
printf("+");
}
else if ((curC+cn>=b && (curC+cn-bestb>x||x>=curC))||(curC+cn<b&&(x>=curC && x<curC+cn))){
printf("+");
}
else{
printf("-");
}
}
curC+=cn;
if (curC>=b) curC-=bestb;
printf("\n");
}
for (int x = besta; x<a; x++){
for (int y = 0; y<b; y++){
printf("-");
}
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... | ||||
