# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40038 | igzi | Scales (IOI15_scales) | C++14 | 0 ms | 2024 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;
void init(int t){
}
int minimum(vector <int> v){
int t1,t2,x=v[0];
t1=getLightest(v[0],v[1],v[2]);
if(t1==x) x=v[1];
t2=getLightest(t1,x,v[3]);
return t2;
}
void orderCoins(){
int t1,t2,x,i,a=-1,b=-1;
vector <int> v,u;
t1=getLightest(1,2,3);
t2=getLightest(4,5,6);
x=1;
if(t1==1) x=2;
x=getLightest(t1,t2,x);
v.push_back(x);
if(t1==x){
for(i=1;i<=3;i++){
if(i!=t1){
if(a==-1) a=i;
else b=i;
}
}
x=getLightest(t2,a,b);
}
else{
for(i=4;i<=6;i++){
if(i!=t2){
if(a==-1) a=i;
else b=i;
}
}
x=getLightest(t1,a,b);
}
v.push_back(x);
for(i=1;i<=6;i++){
if(i!=v[0] && i!=v[1]) u.push_back(i);
}
v.push_back(minimum(u));
u.clear();
for(i=1;i<=6;i++){
if(i!=v[0] && i!=v[1] && i!=v[2]) u.push_back(i);
}
v.push_back(getLightest(u[0],u[1],u[2]));
v.push_back(getMedian(u[0],u[1],u[2]));
for(i=1;i<=6;i++){
if(i!=v[0] && i!=v[1] && i!=v[2] && i!=v[3] && i!=v[4]) v.push_back(i);
}
int ans[7];
for(i=0;i<6;i++){
ans[i]=v[i];
}
answer(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |