# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
619281 | A_D | Scales (IOI15_scales) | C++14 | 1 ms | 288 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() {
set<int> meeee;
for(int i=1;i<=6;i++)meeee.insert(i);
int W[] = {6, 6, 6, 6, 6, 6};
int cnt=0;
int u=getLightest(1,2,3);
int v=getLightest(4,5,6);
set<int> st;
st.insert(1);st.insert(2);st.insert(3);st.insert(4);st.insert(5);st.insert(6);
st.erase(u);st.erase(v);
int c=getLightest(u,v,*st.begin());
int he=c;
W[cnt++]=c;
if(meeee.find(c)==meeee.end()){
// answer(W);
// return;
}
meeee.erase(c);
vector<int> vec;
for(auto x:meeee)vec.push_back(x);
u=getLightest(vec[0],vec[1],vec[2]);
c=getLightest(vec[3],vec[4],u);
W[cnt++]=c;
meeee.erase(c);
if(meeee.find(c)==meeee.end()){
// answer(W);
// return;
}
vec.clear();
for(auto x:meeee)vec.push_back(x);
int vv=vec[0];
u=getLightest(vec[0],vec[1],vec[2]);
if(vv==u)vv=vec[1];
c=getLightest(vec[3],vv,u);
W[cnt++]=c;
if(meeee.find(c)==meeee.end()){
// answer(W);
// return;
}
meeee.erase(c);
vec.clear();
for(auto x:meeee)vec.push_back(x);
c=getLightest(vec[0],vec[1],vec[2]);
W[cnt++]=c;
if(meeee.find(c)==meeee.end()){
// answer(W);
// return;
}
meeee.erase(c);
vec.clear();
for(auto x:meeee)vec.push_back(x);
u=getMedian(vec[0],vec[1],he);
W[cnt++]=u;
if(meeee.find(u)==meeee.end()){
// answer(W);
// return;
}
meeee.erase(u);
W[cnt]=*meeee.begin();
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |