# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
65211 | kylych03 | Scales (IOI15_scales) | C++14 | 4 ms | 664 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 "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
void init(int T) {
/* ... */
//orderCoins();
}
void orderCoins() {
/* ... */
int W[] = {1, 2, 0, 0, 5, 6};
int b=getMedian(1,2,3);
int c=getHeaviest(1,2,3);
int a=getLightest(1,2,3);
int b1=getMedian(4,5,6);
int c1=getHeaviest(4,5,6);
int a1=getLightest(4,5,6);
W[0]=getLightest(a,b,a1);
W[5]=getHeaviest(c,c1,b);
if(W[0]==a)
W[1]=getLightest(c,b,a1);
else
W[1]=getLightest(a,b,b1);
if(W[5]==c)
W[4]=getHeaviest(a,c1,b);
else
W[4]=getHeaviest(b,c,b1);
int ar[1000];
for(int i=1;i<=6;i++)
ar[i]=0;
for(int i=0;i<6;i++)
ar[W[i]]=1;
a=0;
for(int i=1;i<=6;i++)
if(ar[i]==0){
if(a==0)
a=i;
else
b=i;
}
W[3]=getHeaviest(a,W[0],b);
if(W[3]==a)
W[2]=b;
else
W[2]=a;
answer(W);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |