# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
678279 | coding_snorlax | Scales (IOI15_scales) | C++14 | 1 ms | 308 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) {
int hello = 0;
return;
}
void orderCoins() {
/* ... */
vector<int> now;
int place = 0;
now.push_back(getLightest(1,2,3));
now.push_back(getMedian(1,2,3));
now.push_back(6-now[0]-now[1]);
int New = getHeaviest(now[0],now[1],4);
if(New == 4){
if(getHeaviest(now[1],now[2],4)==4) now.push_back(4);
else now.insert(now.begin()+2,4);
}
else{
if(getMedian(now[0],now[1],4)==4) now.insert(now.begin()+1,4);
else now.insert(now.begin(),4);
}
New = getHeaviest(now[0],now[1],5);
if(New == 5){
if(getHeaviest(now[2],now[3],5)==5) now.push_back(5);
else{
if(getHeaviest(now[1],5,now[2])==5) now.insert(now.begin()+3,5);
else now.insert(now.begin()+2,5);
}
}
else{
if(getMedian(now[0],now[1],5)==5) now.insert(now.begin()+1,5);
else now.insert(now.begin(),5);
}
New = getHeaviest(now[1],now[2],6);
if(New == 6){
if(getHeaviest(now[3],now[4],6)==6) now.push_back(6);
else{
if(getHeaviest(now[2],6,now[3])==6) now.insert(now.begin()+4,6);
now.insert(now.begin()+3,6);
}
}
else{
if(getMedian(now[1],now[2],6)==6) now.insert(now.begin()+2,6);
else{
if(getMedian(now[0],now[1],6)==6) now.insert(now.begin()+1,6);
else now.insert(now.begin(),6);
}
}
int final_answer[] = {now[0],now[1],now[2],now[3],now[4],now[5]};
answer(final_answer);
return;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |