# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
835038 | MadokaMagicaFan | Scales (IOI15_scales) | C++14 | 1 ms | 428 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;
void init(int T) {
}
int c = 0;
int isGreater(int a, int b) {
int k;
if (a == 1 && b == 6) k = 2;
else if (a == 6 && b == 1) k = 2;
else if (b == 6) k = 1;
else if (a == 6) k = 1;
else k = 6;
int v1, v2, v3;
v3 = getHeaviest(a, b, k);
v2 = getMedian(a, b, k);
v1 = getLightest(a, b, k);
c += 3;
if (v1 == b) return 1;
if (v1 == a || v2 == a) return 0;
return 1;
}
void orderCoins() {
int ans[6];
int k;
for (int i = 1; i <= 6; ++i)
ans[i-1] = i;
for (int i = 0; i < 6; ++i) {
for (int j = i+1; j < 6; ++j) {
if (isGreater(ans[i], ans[j]))
swap(ans[i], ans[j]);
}
}
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |