# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
617945 | blue | Scales (IOI15_scales) | C++17 | 1 ms | 280 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;
//9 QUERIES
using vi = vector<int>;
using vvi = vector<vi>;
#define sz(x) int(x.size())
void init(int T) {
/* ... */
}
void orderCoins()
{
int l1 = getLightest(1, 2, 3);
int l2 = getLightest(4, 5, 6);
int k = 1;
while(k == l1 || k == l2)
k++;
int a = getLightest(l1, l2, k);
// cerr << "a = " << a << '\n';
vi rem;
for(int i = 1; i <= 6; i++)
if(i != a)
rem.push_back(i);
int b = getLightest(rem[0], rem[1], getLightest(rem[2], rem[3], rem[4]));
vi rem2;
for(int x : rem)
if(x != b)
rem2.push_back(x);
int c = getMedian(b, rem2[0], getLightest(rem2[1], rem2[2], rem2[3]));
vi rem3;
for(int x : rem2)
if(x != c)
rem3.push_back(x);
int d = getLightest(rem3[0], rem3[1], rem3[2]);
int e = getMedian(rem3[0], rem3[1], rem3[2]);
int f = rem3[0] + rem3[1] + rem3[2] - d - e;
int W[] = {a, b, c, d, e, f};
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |