# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
134548 | Boxworld | Scales (IOI15_scales) | C++14 | 3 ms | 380 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"
#include <bits/stdc++.h>
using namespace std;
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-D-E;
int G1=getMedian(A,C,D);
int H,I,J,K;
if (G1==A){
W[5]=D;
J=C;K=A;
}else if (G1==C){
W[5]=A;
J=D;K=C;
}else if (G1==D){
W[5]=A;
J=C;K=D;
}
int G=getMedian(B,E,F);//6
if (G==E){
W[0]=B;
H=E;I=F;
}else if (G==B){
W[0]=E;
H=B;I=F;
}else if (G==F){
W[0]=E;
H=F;I=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){
W[1]=H;W[2]=I;W[3]=J;W[4]=K;
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... |