# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
415182 | victoriad | Scales (IOI15_scales) | C++14 | 2 ms | 280 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 <vector>
using namespace std;
void init(int T) {
/* ... */
}
void orderCoins() {
vector<bool>co(7,false);
int ANS[6];
int l=getLightest(1,2,3);
l=getLightest(l,4,5);
if(l!=3)l=getLightest(3,l,6);
else l=getLightest(l,4,6);
ANS[0]=l;
co[l]=true;
int a=-1,b=-1,c=-1;
for(int i=1;i<7;i++){
if(!co[i]){
if(a==-1)a=i;
else if(b==-1)b=i;
else if(c==-1){
c=i;
l=getLightest(a,b,c);
break;
}
}
}
a=-1;
b=-1;
for(int i=c+1;i<7;i++){
if(!co[i]){
if(a==-1)a=i;
else if(b==-1)b=i;
}
}
l=getLightest(a,b,l);
ANS[1]=l;
co[l]=true;
a=-1;
b=-1;
c=-1;
for(int i=1;i<7;i++){
if(!co[i]){
if(a==-1)a=i;
else if(b==-1)b=i;
else if(c==-1){
c=i;
l=getLightest(a,b,c);
}
else{
if(c!=l)
l=getLightest(l,i,c);
else l=getLightest(l,i,a);
}
}
}
ANS[2]=l;
co[l]=true;
a=-1;
b=-1;
c=-1;
for(int i=1;i<7;i++){
if(!co[i]){
if(a==-1)a=i;
else if(b==-1)b=i;
else if(c==-1){
c=i;
l=getLightest(a,b,c);
ANS[3]=l;
co[l]=true;
l=getMedian(a,b,c);
ANS[4]=l;
co[l]=true;
}
}
}
for(int i=1;i<7;i++){
if(!co[i])ANS[5]=i;
}
answer(ANS);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |