# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
286303 | dolphingarlic | Scales (IOI15_scales) | C++14 | 1 ms | 384 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() {
deque<int> K;
K.push_back(getLightest(1, 2, 3));
K.push_back(getMedian(1, 2, 3));
K.push_back(6 - K[0] - K[1]);
int four_pos = getNextLightest(K[0], K[1], K[2], 4);
if (four_pos == K[2] && getHeaviest(K[1], K[2], 4) == 4) K.push_back(4);
else K.insert(find(K.begin(), K.end(), four_pos), 4);
int five_pos = getNextLightest(K[1], K[2], K[3], 5);
if (five_pos == K[3] && getHeaviest(K[2], K[3], 5) == 5) K.push_back(5);
else if (five_pos == K[1] && getLightest(K[0], K[1], 5) == 5) K.push_front(5);
else K.insert(find(K.begin(), K.end(), five_pos), 5);
int six_pos = getNextLightest(K[2], K[3], K[4], 6);
if (six_pos == K[4] && getHeaviest(K[3], K[4], 6) == 6) K.push_back(6);
else if (six_pos == K[2]) K.insert(find(K.begin(), K.end(), getNextLightest(K[0], K[1], K[2], 6)), 6);
else K.insert(find(K.begin(), K.end(), five_pos), 6);
int W[6] = {K[0], K[1], K[2], K[3], K[4], K[5]};
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |