# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
471998 | nicholask | Scales (IOI15_scales) | C++14 | 1 ms | 292 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 r1,r2;
void orderCoins() {
vector <int> ans;
r1=getHeaviest(1,2,3);
r2=getLightest(1,2,3);
ans.push_back(r2);
ans.push_back(6-r1-r2);
ans.push_back(r1);
r1=getNextLightest(ans[0],ans[1],ans[2],4);
if (r1==ans[0]){
r1=getLightest(4,ans[0],ans[1]);
if (r1==4) ans.insert(ans.begin(),4);
else ans.push_back(4);
} else if (r1==ans[1]){
ans.insert(ans.begin()+1,4);
} else {
ans.insert(ans.begin()+2,4);
}
r1=getNextLightest(ans[0],ans[2],ans[3],5);
if (r1==ans[0]){
r1=getLightest(5,ans[0],ans[1]);
if (r1==5) ans.insert(ans.begin(),5);
else ans.push_back(5);
} else if (r1==ans[2]){
r1=getLightest(5,ans[1],ans[2]);
if (r1==5) ans.insert(ans.begin()+1,5);
else ans.insert(ans.begin()+2,5);
} else {
ans.insert(ans.begin()+3,5);
}
r1=getNextLightest(ans[0],ans[2],ans[4],6);
if (r1==ans[0]){
r1=getLightest(6,ans[0],ans[1]);
if (r1==6) ans.insert(ans.begin(),6);
else ans.push_back(6);
} else if (r1==ans[2]){
r1=getLightest(6,ans[1],ans[2]);
if (r1==6) ans.insert(ans.begin()+1,6);
else ans.insert(ans.begin()+2,6);
} else {
r1=getLightest(6,ans[3],ans[4]);
if (r1==6) ans.insert(ans.begin()+3,6);
else ans.insert(ans.begin()+4,6);
}
int W[6];
for (int i=0; i<6; i++) W[i]=ans[i];
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |