# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
587339 | Lucpp | Scales (IOI15_scales) | C++17 | 1 ms | 304 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() {
vector<int> v(3);
v[0] = getLightest(1, 2, 3);
v[2] = getHeaviest(1, 2, 3);
v[1] = 6-v[0]-v[2];
for(int i = 4; i <= 6; i++){
int m = getMedian(v[1], v[2], i);
if(m == i) v.insert(v.begin()+2, i);
else if(m == v[1]){
m = getMedian(v[0], v[1], i);
if(m == v[0]) v.insert(v.begin(), i);
else v.insert(v.begin()+1, i);
}
else{
m = getMedian(v[i-3], v[i-2], i);
if(m == i) v.insert(v.begin()+i-2, i);
else if(m == v[i-3]) v.insert(v.begin()+i-3, i);
else v.insert(v.begin()+i-1, i);
}
}
answer(v.data());
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |