# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
744557 | Abrar_Al_Samit | 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"
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
void init(int T) {
}
void orderCoins() {
int a[6] = {1, 2, 3, 4, 5, 6};
//random_shuffle(a, a+6);
solve3(&a[0]);
solve3(&a[3]);
if(getLightest(a[0], a[1], a[3])==a[3]) {
swap(a[0], a[3]);
swap(a[1], a[4]);
swap(a[2], a[5]);
}
int before = getNextLightest(a[0], a[1], a[2], a[3]);
if(before==a[1]) {
swap(a[2], a[3]);
swap(a[1], a[2]);
} else if(before==a[2]) {
swap(a[2], a[3]);
} else {
return a;
}
before = getNextLightest(a[1], a[2], a[3], a[4]);
if(before==a[2]) {
swap(a[3], a[4]);
swap(a[2], a[3]);
} else if(before==a[3]) {
swap(a[3], a[4]);
} else {
return a;
}
return a;
}