# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
617937 | blue | Scales (IOI15_scales) | C++17 | 1 ms | 340 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;
using vi = vector<int>;
using vvi = vector<vi>;
#define sz(x) int(x.size())
void init(int T) {
/* ... */
}
int L;
int cmp(int a, int b)
{
if(a == 0)
return 0;
if(b == 0)
return 1;
if(getHeaviest(L, a, b) == b)
return 1;
else
return 0;
}
void orderCoins() {
int l1 = getLightest(1, 2, 3);
int l2 = getLightest(4, 5, 6);
int k = 1;
while(k == l1 || k == l2)
k++;
L = getLightest(l1, l2, k);
vi res{L};
vi used(7, 0);
used[L] = 1;
for(int t = 1; t <= 5; t++)
{
int c = 0;
for(int i = 1; i <= 6; i++)
{
if(used[i])
continue;
if(cmp(i, c))
c = i;
}
used[c] = 1;
res.push_back(c);
}
int W[] = {res[0], res[1], res[2], res[3], res[4], res[5], res[6]};
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |