# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72836 | square1001 | 저울 (IOI15_scales) | C++14 | 4 ms | 904 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 <vector>
using namespace std;
void init(int T) {
/* ... */
}
void orderCoins() {
vector<int> v = { 1, 2, 3, 4, 5, 6 }, w;
for(int i = 0; i < 3; ++i) {
int cur = v[0];
for(int j = 2; j < v.size(); j += 2) {
cur = getLightest(cur, v[j], v[j - 1]);
}
if(v.size() % 2 == 0) {
cur = getLightest(cur, v.back(), (cur == v[0] ? v[1] : v[0]));
}
w.push_back(cur);
vector<int> nv;
for(int j : v) {
if(j != cur) nv.push_back(j);
}
v = nv;
}
w[3] = getLightest(v[0], v[1], v[2]);
w[4] = getMedian(v[0], v[1], v[2]);
w[5] = v[0] + v[1] + v[2] - w[3] - w[4];
int W[] = {w[0], w[1], w[2], w[3], w[4], w[5]};
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |