# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
619479 | BERNARB01 | 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 <bits/stdc++.h>
#include "scales.h"
using namespace std;
#ifdef B01
#include "../debb.h"
#else
#define deb(...)
#endif
const int n = 6;
void init(int T) {
}
inline int getO(int i) {
return (i + 1) % 3;
}
inline int getOO(int i) {
return (i + 2) % 3;
}
void orderCoins() {
int mnl = getLightest(1, 2, 3);
int mnr = getLightest(4, 5, 6);
int mxl = getHeaviest(1, 2, 3);
int mxr = getHeaviest(4, 5, 6);
int mn = getLightest(mnl, mnr, getO(mnl - 1) + 1);
int mx = getHeaviest(mxl, mxr, getO(mxl - 1) + 1);
int mn2 = (mn == mnl ? getLightest(mnr, getO(mnl - 1) + 1, getOO(mnl - 1) + 1) : getLightest(mnl, getO(mnr - 4) + 4, getOO(mnr - 4) + 4));
int mx2 = (mx == mxl ? getHeaviest(mxr, getO(mxl - 1) + 1, getOO(mxl - 1) + 1) : getHeaviest(mxl, getO(mxr - 4) + 4, getOO(mxr - 4) + 4));
set<int> se = {1, 2, 3, 4, 5, 6};
se.erase(mn);
se.erase(mn2);
se.erase(mx2);
vector<int> z(se.begin(), se.end());
int l = getLightest(z[0], z[1], z[2]);
se.erase(mx);
se.erase(l);
vector<int> w = {mn, mn2, l, *se.begin(), mx2, mx};
answer(w.data());
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |