# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1017169 | huutuan | 저울 (IOI15_scales) | C++14 | 1 ms | 604 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 ans[6];
void orderCoins() {
vector<int> v{1, 2, 3, 4, 5, 6}, v2;
while ((int)v.size()>=3){
int t=getLightest(v[0], v[1], v[2]);
for (int i=(int)v.size()-1; i>=3; i-=2){
if (i!=3) t=getLightest(t, v[i], v[i-1]);
else t=getLightest(t, v[3], t^v[2]^v[1]);
}
v2.push_back(t);
ans[t-1]=(int)v2.size();
v.erase(find(v.begin(), v.end(), t));
}
int t=getMedian(v[0], v[1], v2[0]);
ans[t-1]=5;
ans[(v[0]^v[1]^t)-1]=6;
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |