# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
301756 | square1001 | Scales (IOI15_scales) | C++14 | 1 ms | 384 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 <vector>
using namespace std;
void init(int T) {
/* ... */
}
void orderCoins() {
int LA = getLightest(1, 2, 3);
int LB = getLightest(4, 5, 6);
int LC = getLightest(LA, LB, LA == 1 ? 2 : 1);
vector<int> rank(6, 1);
rank[LC - 1] = 0;
for(int i = 1; i <= 6; ++i) {
for(int j = 1; j < i; ++j) {
if(i != LC && j != LC) {
int res = getHeaviest(i, j, LC);
++rank[res - 1];
}
}
}
vector<int> iperm(6);
for(int i = 0; i < 6; ++i) {
iperm[rank[i]] = i + 1;
}
int W[6] = {iperm[0], iperm[1], iperm[2], iperm[3], iperm[4], iperm[5]};
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |