# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
60703 | dukati8 | Scales (IOI15_scales) | C++14 | 7 ms | 756 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;
#define rep(i,a,b) for(int i=a; i<int(b); i++)
int t;
void init(int T) {
t=T;
}
void orderCoins() {
set<int> leftset={1,2,3,4,5,6};
int W[6];
int cand1,cand2;
cand1=getLightest(1,2,3);
cand2=getLightest(4,5,6);
if (1!=cand1) W[0]=getLightest(cand1,cand2,1);
else W[0]=getLightest(cand1,cand2,2);
leftset.erase(W[0]);
vector<int> left;
for (auto a:leftset) left.push_back(a);
cand1=getLightest(left[0],left[1],left[2]);
W[1]=getLightest(cand1,left[3],left[4]);
leftset.erase(W[1]);
left.clear();
for (auto a:leftset) left.push_back(a);
cand1=getLightest(left[0],left[1],left[2]);
W[2]=getMedian(W[0],cand1,left[3]);
leftset.erase(W[2]);
left.clear();
for (auto a:leftset) left.push_back(a);
W[3]=getLightest(left[0],left[1],left[2]);
W[4]=getMedian(left[0],left[1],left[2]);
W[5]=getHeaviest(left[0],left[1],left[2]);
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |