# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
373397 | luciocf | Scales (IOI15_scales) | C++14 | 1 ms | 492 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 a[4], b[4];
void orderCoins()
{
a[1] = getLightest(1, 2, 3);
a[3] = getHeaviest(1, 2, 3);
bool tem[7];
tem[a[1]] = tem[a[3]] = 1;
if (!tem[1]) a[2] = 1;
else if (!tem[2]) a[2] = 2;
else a[2] = 3;
b[1] = getLightest(4, 5, 6);
b[3] = getHeaviest(4, 5, 6);
tem[b[1]] = tem[b[3]] = 1;
if (!tem[4]) b[2] = 4;
else if (!tem[5]) b[2] = 5;
else b[2] = 6;
int x = getNextLightest(1, 2, 3, b[1]);
int ans[6];
if (x == a[1])
{
ans[0] = a[1], ans[1] = a[2], ans[2] = a[3];
ans[3] = b[1], ans[4] = b[2], ans[5] = b[3];
answer(ans);
return;
}
else if (x == a[2])
{
ans[0] = a[1], ans[1] = b[1], ans[2] = a[2];
}
else
{
ans[0] = a[1], ans[1] = a[2], ans[2] = b[1];
}
x = getMedian(a[3], b[2], b[3]);
if (x == a[3])
{
ans[3] = b[2], ans[4] = a[3], ans[5] = b[3];
}
else if (x == b[2])
{
ans[3] = a[3], ans[4] = b[2], ans[5] = b[3];
}
else
{
ans[3] = b[2], ans[4] = b[3], ans[5] = a[3];
}
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |