# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
791785 | Josia | Scales (IOI15_scales) | C++17 | 1 ms | 304 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"
using namespace std;
#include <bits/stdc++.h>
void init(int T) {
/* ... */
}
void orderCoins() {
int a1 = getLightest(1, 2, 3);
int a2 = getMedian(1, 2, 3);
set<int> a = {1,2,3};
a.erase(a1);
a.erase(a2);
int a3 = *a.begin();
int b1 = getLightest(4,5,6);
int b2 = getMedian(4,5,6);
set<int> b = {4,5,6};
b.erase(b1);
b.erase(b2);
int b3 = *b.begin();
deque<int> A, B;
A = {a1, a2, a3};
B = {b1, b2, b3};
vector<int> res;
for (int i = 0; i<2; i++) {
int next = getNextLightest(B[0], B[1], A[1], A[0]);
if (next == B[0]) {
res.push_back(A[0]);
res.push_back(B[0]);
} else {
res.push_back(B[0]);
res.push_back(A[0]);
}
A.pop_front();
B.pop_front();
}
res.push_back(getMedian(res[0], A[0], B[0]));
set<int> aaa = {1,2,3,4,5,6};
for (int i: res) aaa.erase(i);
res.push_back(*aaa.begin());
int W[] = {1,2,3,4,5,6};
for (int i = 0; i<6; i++) {
W[i] = res[i];
// cerr << res[i] << " ";
}
// cerr << "\n";
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |