# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1038591 | HappyCapybara | Scales (IOI15_scales) | C++17 | 1 ms | 436 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;
void init(int T){
return;
}
void orderCoins(){
int W[6];
vector<int> a(3), b(3);
a[0] = getLightest(1, 2, 3);
a[1] = getMedian(1, 2, 3);
a[2] = 6-a[0]-a[1];
b[0] = getLightest(4, 5, 6);
b[1] = getMedian(4, 5, 6);
b[2] = 15-b[0]-b[1];
int l = 0, r = 0;
int cur = 0;
while (l < 3 && r < 3){
if (l < 2) W[cur] = getLightest(a[l], b[r], a[2]);
else if (r < 2) W[cur] = getLightest(a[l], b[r], b[2]);
else {
W[5] = getHeaviest(a[l], b[r], a[0]);
W[4] = 21-(W[0]+W[1]+W[2]+W[3]+W[5]);
answer(W);
return;
}
if (W[cur] == a[l]) l++;
else r++;
cur++;
}
while (cur < 6){
if (l < 3) W[cur] = a[l];
else W[cur] = b[r];
cur++;
l++;
r++;
}
answer(W);
return;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |