# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
520082 | pisikaka | Scales (IOI15_scales) | C++17 | 0 ms | 0 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"
void init(int T) {
}
void orderCoins() {
int W[] = {1, 2, 3, 4, 5, 6}, ans[6];
w[0] = getLightest(1,2,3);
w[1] = getMedian(1,2,3);
w[2] = (w[0]!=1&&w[1]!=1?1 : (w[0]!=2&&w[1]!=2 ? 2 : 3));
w[4] = getMedian(4,5,6);
w[5] = getHeaviest(4, 5 ,6);
w[3] = (w[4]!=1&&w[5]!=1?1 : (w[4]!=2&&w[5]!=2 ? 2 : 3));
int a = getLightest(w[2], w[3], w[5]), b = getHeaviest(w[2],w[3],w[0]);
w[2] = a;
w[3] = b;
ans[0] = getLightest(w[0],w[2],w[4]);
ans[2] = getMedian(w[0],w[2],w[4]);
ans[4] = getHeaviest(w[0],w[2],w[4]);
ans[1] = getLightest(w[1],w[3],w[5]);
ans[3] = getMedian(w[1],w[3],w[5]);
ans[5] = getHeaviest(w[1],w[3],w[5]);
answer(ans);
return;
}