# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
619795 | someone | Scales (IOI15_scales) | C++14 | 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 ans[6];
for(int i = 0; i < 6; i++)
ans[i] = i+1;
for(int i = 0; i < 4; i++) {
for(int j = i; j < 5; j += 2) {
if(j == 4) {
int lightest = getLightest(ans[i], ans[j], ans[j+1]);
if(lightest == ans[j+1])
swap(ans[j+1], ans[i]);
} else {
int lightest = getLightest(ans[i], ans[j+1], ans[j+2]);
if(lightest == ans[j+1])
swap(ans[j+1], ans[i]);
else if(lightest == ans[j+2])
swap(ans[j+2], ans[i]);
}
}
}
if(getHeaviest(ans[0], ans[4], ans[5]) == ans[4])
swap(ans[4], ans[5]);
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |