# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
394440 | rainboy | Scales (IOI15_scales) | C11 | 1 ms | 284 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"
void init(int T) {}
void orderCoins() {
static int aa[6];
int i, j, tmp;
for (i = 0; i < 6; i++)
aa[i] = i + 1;
for (i = 0; i <= 3; i++) {
int a, b, j_, tmp;
a = getLightest(aa[i], aa[i + 1], aa[i + 2]), b = a == aa[i] ? aa[i + 1] : aa[i];
if (a == aa[i])
j_ = i;
else if (a == aa[i + 1])
j_ = i + 1;
else
j_ = i + 2;
for (j = i + 3; j < 6; j++)
if (getLightest(a, b, aa[j]) == aa[j])
a = aa[j], j_ = j;
tmp = aa[i], aa[i] = aa[j_], aa[j_] = tmp;
}
if (getHeaviest(aa[3], aa[4], aa[5]) == aa[4])
tmp = aa[4], aa[4] = aa[5], aa[5] = tmp;
answer(aa);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |