# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
134546 | Boxworld | Scales (IOI15_scales) | C++14 | 3 ms | 632 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "scales.h"
void init(int T) {
/* ... */
}
void orderCoins() {
int W[6];
int A=getHeaviest(1,2,3);
int B=getLightest(1,2,3);
int C=6-A-B;
int D=getHeaviest(4,5,6);
int E=getLightest(4,5,6);
int F=15-C-D;
int F1=getMedian(A,C,D);
int H,I,J,K;
if (F1==A){
W[5]=D;K=W[4]=A;J=W[3]=C;
}else if (F1==C){
W[5]=A;K=W[4]=C;J=W[3]=D;
}else if (F1==D){
W[5]=A;K=W[4]=D;J=W[3]=C;
}
int G=getMedian(B,E,F);//6
if (G==E){
W[0]=B;H=W[1]=E;I=W[2]=F;
}else if (G==B){
W[0]=E;H=W[1]=B;I=W[2]=F;
}else if (G==F){
W[0]=E;H=W[1]=F;I=W[2]=B;
}
int L=getMedian(H,I,J);
if (L==H){
int M=getNextLightest(H,I,J,K);
if (M==J){
W[1]=J;W[2]=H;W[3]=I;W[4]=K;
answer(W);
}else if (M==H){
W[1]=J;W[2]=K;W[3]=H;W[4]=I;
answer(W);
}else if (M==I){
W[1]=J;W[2]=H;W[3]=K;W[4]=I;
answer(W);
}
}else if (L==I){
answer(W);
}else if (L==J){
int M=getNextLightest(H,I,J,K);
if (M==H){
W[1]=H;W[2]=J;W[3]=I;W[4]=K;
answer(W);
}else if (M==I){
W[1]=H;W[2]=J;W[3]=K;W[4]=I;
answer(W);
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |