# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596872 | PiejanVDC | Scales (IOI15_scales) | C++17 | 1 ms | 212 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] = {1, 2, 3, 4, 5, 6};
for(int t = 0 ; t < 2 ; t++) {
for(int i = 0 ; i < 4 ; i++) {
int a = getLightest(ans[i], ans[i+1], ans[i+2]);
if(ans[i+1] == a)
swap(ans[i], ans[i+1]);
if(ans[i+2] == a)
swap(ans[i], ans[i+2]);
}
int b = getHeaviest(ans[3], ans[4], ans[5]);
if(ans[3] == b)
swap(ans[3], ans[5]);
if(ans[4] == b)
swap(ans[4], ans[5]);
}
int i = 0;
int a = getLightest(ans[i], ans[i+1], ans[i+2]);
if(ans[i+1] == a)
swap(ans[i], ans[i+1]);
if(ans[i+2] == a)
swap(ans[i], ans[i+2]);
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |