# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121010 | SalihSahin | Scales (IOI15_scales) | C++14 | 1 ms | 592 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>
#define pb push_back
using namespace std;
#include "scales.h"
void init(int T) {
/* ... */
}
void orderCoins() {
int W[6];
int x = getLightest(1, 2, 3);
int y = getHeaviest(1, 2, 3);
vector<int> l = {x, 6 - (x + y), y};
x = getLightest(4, 5, 6);
y = getHeaviest(4, 5, 6);
vector<int> r = {x, 15 - (x + y), y};
int other = 1;
while(other == l[2] || other == r[2]) other++;
int mx = getHeaviest(l[2], r[2], other);
int li = 0, ri = 0;
for(int i = 0; i < 5; i++){
if(li == 3 || mx == l[li]){
W[i] = r[ri];
ri++;
continue;
}
if(ri == 3 || mx == r[ri]){
W[i] = l[li];
li++;
continue;
}
int now = getLightest(l[li], r[ri], mx);
W[i] = now;
if(now == l[li]){
li++;
}
else ri++;
}
W[5] = mx;
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |