# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401987 | ja_kingy | Scales (IOI15_scales) | C++14 | 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.
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
void init(int T) {
/* ... */
}
void orderCoins() {
/* ... */
int W[] = {1, 2, 3, 4, 5, 6};
for (int i = 5; i >= 2; --i) {
for (int j = 2; j <= i; j=min(i,j+2)) {
int res = getHeaviest(W[j-2],W[j-1],W[j]);
for (int k = j-2; k < j; k++) if (W[k] == res) swap(W[k],W[j]);
if (j == i) break;
}
}
if (getLightest(W[0], W[1], W[2]) == W[1]) swap(W[1], W[0]);
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |