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