# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1034188 | Zicrus | Scales (IOI15_scales) | C++17 | 1 ms | 604 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 <bits/stdc++.h>
#include "scales.h"
using namespace std;
typedef long long ll;
void init(int T) {
/* ... */
}
void orderCoins() {
vector<int> res = {1, 2, 3, 4, 5, 6};
int a = getHeaviest(1, 2, 3);
int b = getHeaviest(4, 5, 6);
int c = getHeaviest(a, b, 1 == a || 1 == b ? (2 == a || 2 == b ? 3 : 2) : 1);
res[5] = c;
int d = c <= 3 ? getHeaviest(b, 1 == c ? 3 : 1, 2 == c ? 3 : 2) : getHeaviest(a, 4 == c ? 6 : 4, 5 == c ? 6 : 5);
res[4] = d;
vector<int> s;
for (int i = 1; i <= 6; i++) {
if (i != c && i != d) s.push_back(i);
}
int e = getHeaviest(s[0], s[1], s[2]);
int f = getHeaviest(e, s[3], s[0] == e ? s[1] : s[0]);
res[3] = f;
s = vector<int>();
for (int i = 1; i <= 6; i++) {
if (i != c && i != d && i != f) s.push_back(i);
}
res[2] = getHeaviest(s[0], s[1], s[2]);
res[1] = getMedian(s[0], s[1], s[2]);
res[0] = getLightest(s[0], s[1], s[2]);
int W[6] = {res[0], res[1], res[2], res[3], res[4], res[5]};
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |