# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
115507 | E869120 | Scales (IOI15_scales) | C++14 | 3 ms | 384 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) {
/* ... */
}
int getLight(vector<int>V) {
int ret = V[0], cx = 1;
while (cx < (int)V.size()) {
int u1 = ret, u2 = V[cx], u3 = cx + 1;
if (u3 >= V.size()) {
for (int i = 0; i < V.size(); i++) { if (u1 != V[i] && u2 != V[i]) { u3 = V[i]; break; } }
}
else u3 = V[cx + 1];
int G = getLightest(u1, u2, u3);
ret = G; cx += 2;
}
return ret;
}
void orderCoins() {
vector<int>vec, L = {1, 2, 3, 4, 5, 6};
for (int i = 1; i <= 3; i++) {
int P = getLight(L); vec.push_back(P);
vector<int> LL; for (int j = 0; j < L.size(); j++) { if (L[j] != P) LL.push_back(L[j]); }
L = LL;
}
vector<int>I = L;
vec.push_back(getLightest(I[0], I[1], I[2]));
vec.push_back(getMedian(I[0], I[1], I[2]));
for (int i = 1; i <= 6; i++) {
bool flag = false; for (int j = 0; j < vec.size(); j++) { if (vec[j] == i) flag = true; }
if (flag == false) vec.push_back(i);
}
int FinalAns[6]; for (int i = 0; i < 6; i++) FinalAns[i] = vec[i];
answer(FinalAns);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |