# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
388892 | MeGustaElArroz23 | Scales (IOI15_scales) | C++14 | 1 ms | 208 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<bits/stdc++.h>
#include "scales.h"
using namespace std;
typedef vector<int> vi;
void init(int T){ return;}
void orderCoins(){
vi a={1,2,3},b={4,5,6};
vi sola(3),solb(3);
sola[0]=getLightest(1,2,3);
sola[1]=getMedian(1,2,3);
if (sola[0]+sola[1]==4) sola[2]=2;
else if (sola[0]+sola[1]==5) sola[2]=1;
else sola[2]=3;
solb[0]=getLightest(4,5,6);
solb[1]=getMedian(4,5,6);
if (solb[0]+solb[1]==9) solb[2]=6;
else if (solb[0]+solb[1]==11) solb[2]=4;
else solb[2]=5;
int sol[6];
int aux=sola[2];
int i=0,j=0;
while (i+j<4 and i<3 and j<3){
sol[i+j]=getLightest(sola[i],solb[j],aux);
if (sol[i+j]==sola[i]) i++;
else j++;
if (i==2) aux=solb[2];
}
if (i==3){
while (j<3){
sol[i+j]=solb[j];
j++;
}
}
else if (j==3){
while (i<3){
sol[i+j]=sola[i];
i++;
}
}
else{
sol[5]=getHeaviest(sola[0],sola[2],solb[2]);
if (sol[5]==sola[2]) sol[4]=solb[2];
else sol[4]=sola[2];
}
answer(sol);
return;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |