# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
93467 | tincamatei | Scales (IOI15_scales) | C++14 | 14 ms | 508 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 <vector>
#include "scales.h"
void init(int T) {
/* ... */
}
void eraseVector(int val, std::vector<int> &x) {
int i = 0;
while(x[i] != val)
++i;
x.erase(x.begin() + i);
}
void orderCoins() {
int w[6];
std::vector<int> x{1, 2, 3, 4, 5, 6};
int lgt = getLightest(x[0], getLightest(x[0], x[1], x[2]), getLightest(x[3], x[4], x[5]));
w[0] = lgt;
eraseVector(lgt, x);
lgt = getLightest(x[0], x[1], x[2]);
lgt = getLightest(lgt, x[3], x[4]);
w[1] = lgt;
eraseVector(lgt, x);
lgt = getLightest(x[0], x[1], x[2]);
if(x[0] != lgt) lgt = getLightest(x[3], lgt, x[0]);
else lgt = getLightest(x[3], lgt, x[1]);
w[2] = lgt;
eraseVector(lgt, x);
lgt = getLightest(x[0], x[1], x[2]);
w[3] = lgt;
lgt = getMedian(x[0], x[1], x[2]);
w[4] = lgt;
w[5] = x[0] + x[1] + x[2] - w[3] - w[4];
answer(w);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |