#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
void init(int T) {
}
void orderCoins() {
int W[6];
vector<int> vec;
for(int i=1;i<=6;i++) vec.push_back(i);
for(int i=0;i<4;i++) {
int c=vec[0];
for(int j=1;j<vec.size();j+=2) {
int s=j+1;
if(s==vec.size()) s=1;
c=getLightest(c, vec[j], s);
}
vec.erase(lower_bound(vec.begin(), vec.end(), c));
W[i]=c;
}
W[4]=getMedian(vec[0], vec[1], W[0]);
vec.erase(lower_bound(vec.begin(), vec.end(), W[4]));
W[5]=vec.front();
answer(W);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |