# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
579278 | Leo121 | 저울 (IOI15_scales) | C++14 | 1 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "scales.h"
void init(int T) {
/* ... */
}
void orderCoins() {
/* ... */
int W[] = {1, 2, 3, 4, 5, 6};
int res = getLightest(1, 2, 3), res3 = getHeaviest(1, 2, 3), res2, res4, res5;
res2 = 6 - res - res3;
res4 = getNextLightest(1, 2, 3, 4);
bool bandera = 1;
W[0] = res;
if(res4 != res){
if(res4 == res2){
W[1] = 4;
W[2] = res2;
W[3] = res3;
res = 4;
}
else if(res4 == res3){
W[2] = 4;
W[1] = res2;
W[3] = res3;
res = res2;
res2 = 4;
}
}
else{
res5 = res;
res = 4;
res4 = getHeaviest(res, res2, res3);
if(res4 == res3){
res = res5;
bandera = 0;
}
else if(res4 == res){
W[0] = res5;
W[1] = res2;
W[2] = res3;
W[4] = 4;
res = res2;
res2 = res3;
res3 = 4;
}
}
int poracomodar1 = 10 - res - res2 - res3, poracomodar2, poracomodar3;
res4 = getNextLightest(res, res2, res3, 5);
if(res4 != res){
poracomodar2 = res;
if(res4 == res2){
W[1] = res;
W[2] = 5;
W[3] = res2;
W[4] = res3;
res = 5;
}
else if(res4 == res3){
W[1] = res;
W[2] = res2;
W[3] = 5;
W[4] = res3;
res = res2;
res2 = 5;
}
}
else{
res5 = res;
res = 5;
res4 = getHeaviest(res, res2, res3);
if(res4 == res3){
res = res5;
poracomodar2 = 5;
bandera = 0;
}
else if(res4 == res){
W[1] = res5;
W[2] = res2;
W[3] = res3;
W[4] = 5;
res = res2;
res2 = res3;
res3 = 5;
poracomodar2 = res5;
}
}
res4 = getNextLightest(res, res2, res3, 6);
if(res4 != res){
poracomodar3 = res;
if(res4 == res2){
W[2] = res;
W[3] = 6;
W[4] = res2;
W[5] = res3;
res = 6;
}
else if(res4 == res3){
res = res2;
res2 = 6;
W[2] = res;
W[3] = res2;
W[4] = 6;
W[5] = res3;
}
}
else{
res5 = res;
res = 6;
res4 = getHeaviest(res, res2, res3);
if(res4 == res3){
res = res5;
poracomodar3 = 6;
bandera = 0;
}
else if(res4 == res){
res = res2;
res2 = res3;
res3 = 6;
poracomodar3 = res5;
W[2] = res5;
W[3] = res2;
W[4] = res3;
W[5] = 6;
}
}
if(!bandera){
W[5] = res3;
W[4] = res2;
W[3] = res;
res = getLightest(poracomodar1, poracomodar2, poracomodar3), res2 = getHeaviest(poracomodar1, poracomodar2, poracomodar3);
W[2] = res2;
W[0] = res;
W[1] = poracomodar1 + poracomodar2 + poracomodar3 - res - res2;
}
answer(W);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |