# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
528324 | Cyanmond | Scales (IOI15_scales) | C++17 | 1 ms | 300 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.
// clang-format off
#include "scales.h"
#include <bits/stdc++.h>
void init(int T) {
/* ... */
}
void orderCoins() {
std::array<int, 3> A, B;
{
const int x = getHeaviest(1, 2, 3);
const int y = getLightest(1, 2, 3);
int z = 0;
for (int i = 1; i <= 3; ++i) {
if (i != x and i != y) z = i;
}
A = {x, z, y};
}
{
const int x = getHeaviest(4, 5, 6);
const int y = getLightest(4, 5, 6);
int z = 0;
for (int i = 4; i <= 6; ++i) {
if (i != x and i != y) z = i;
}
B = {x, z, y};
}
std::vector<int> res(3);
for (int i = 0; i < 3; ++i) res[i] = A[i];
for (int i = 4; i <= 6; ++i) {
const int m = getNextLightest(1, 2, 3, i);
res.insert(std::find(res.begin(), res.end(), m), i);
}
int gb[6];
for (int i = 0; i < 6; ++i) gb[i] = res[i];
answer(gb);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |