# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
720733 | PenguinsAreCute | 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;
void init(int T) {}
void orderCoins() {
int A[3], B[3], heavy;
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];
heavy = getHeaviest(A[0], A[2], B[2]);
int lptr = 0, rptr = 0;
int W[6];
for(int i = 0; i < 6; i++) {
if(lptr == 3) {
W[i] = B[rptr];
rptr++;
} else if(rptr == 3) {
W[i] = A[lptr];
lptr++;
} else if(A[lptr] == heavy) {
W[i] = B[rptr];
rptr++;
} else if(B[rptr] == heavy) {
W[i] = A[lptr];
lptr++;
} else if(getLightest(heavy, A[lptr], B[rptr]) == A[lptr]) {
W[i] = A[lptr];
lptr++;
} else {
W[i] = B[rptr];
rptr++;
}
}
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |