# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
290738 | kshitij_sodani | Scales (IOI15_scales) | C++14 | 1 ms | 256 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 a first
#define b second
#define pb push_back
void init(int T) {
/* ... */
}
void orderCoins() {
/* ... */
vector<int> cur;
int aa=1;
int bb=2;
int cc=3;
cur.pb(getLightest(aa,bb,cc));
cur.pb(getMedian(aa,bb,cc));
for(int i=1;i<=3;i++){
if(i!=cur[0] and i!=cur[1]){
cur.pb(i);
}
}
for(int i=4;i<=6;i++){
if(getLightest(i,cur[0],cur[1])==i){
reverse(cur.begin(),cur.end());
cur.pb(i);
reverse(cur.begin(),cur.end());
}
else{
int st=0;
for(int ii=0;ii<cur.size()-1;ii++){
if(getMedian(i,cur[ii],cur[ii+1])==i){
st=1;
vector<int> cur2;
for(int j=0;j<=ii;j++){
cur2.pb(cur[j]);
}
cur2.pb(i);
for(int j=ii+1;j<cur.size();j++){
cur2.pb(cur[j]);
}
cur=cur2;
break;
}
}
if(st==0){
cur.pb(i);
}
}
}
int ww[6];
for(int i=0;i<6;i++){
ww[i]=cur[i];
}
answer(ww);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |