# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
482725 | dxz05 | Scales (IOI15_scales) | C++14 | 1 ms | 292 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 W[] = {1, 2, 3, 4, 5, 6};
for (int i = 0; i < 3; i++){
for (int j = i; j < 6; j++){
vector<int> v;
for (int k = i; k < 6; k++){
if (k != j) v.push_back(k);
}
bool ok = true;
if (v.size() & 1){
v.push_back(v[v.size() - 2]);
}
for (int k = 0; k + 1 < v.size(); k += 2){
ok &= getLightest(W[j], W[v[k]], W[v[k + 1]]) == W[j];
}
if (ok){
swap(W[i], W[j]);
break;
}
}
}
int A = getLightest(W[3], W[4], W[5]);
int B = getMedian(W[3], W[4], W[5]);
int C = getHeaviest(W[3], W[4], W[5]);
W[3] = A, W[4] = B, W[5] = C;
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |