# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1076133 | jk_ | Scales (IOI15_scales) | C++14 | 1 ms | 348 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 <array>
#include <cassert>
#include <vector>
#include <algorithm>
#include "scales.h"
using namespace std;
void init(int) {}
void orderCoins() {
vector<int> c{1,2,3,4,5,6};
vector<int> ans;
{
int a = getLightest(1,2,3);
int b = getLightest(4,5,6);
ans.push_back(getLightest(a, b, (a==1 ? 2 : 1)));
c.erase(find(c.begin(), c.end(),ans[0]));
}
{
int a = getLightest(c[0], c[1], c[2]);
int b = getLightest(a, c[3], c[4]);
ans.push_back(b);
c.erase(find(c.begin(), c.end(), ans[1]));
}
{
int a = getLightest(c[0], c[1], c[2]);
int b = (a==c[0] ? c[1] : c[0]);
ans.push_back(getLightest(a, b, c[3]));
c.erase(find(c.begin(), c.end(), ans[2]));
}
{
int a = getLightest(c[0], c[1], c[2]);
ans.push_back(a);
c.erase(find(c.begin(), c.end(), ans[3]));
}
{
int a = getHeaviest(ans[0], c[0], c[1]);
int b = a==c[0] ? c[1] : c[0];
ans.push_back(b);
ans.push_back(a);
}
answer(ans.data());
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |