Submission #40038

# Submission time Handle Problem Language Result Execution time Memory
40038 2018-01-25T16:46:57 Z igzi Scales (IOI15_scales) C++14
55.5556 / 100
0 ms 2024 KB
#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

scales.cpp:6:15: warning: unused parameter 't' [-Wunused-parameter]
 void init(int t){
               ^
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 2024 KB Output is partially correct
2 Partially correct 0 ms 2024 KB Output is partially correct
3 Partially correct 0 ms 2024 KB Output is partially correct
4 Partially correct 0 ms 2024 KB Output is partially correct
5 Partially correct 0 ms 2024 KB Output is partially correct
6 Partially correct 0 ms 2024 KB Output is partially correct
7 Partially correct 0 ms 2024 KB Output is partially correct
8 Partially correct 0 ms 2024 KB Output is partially correct
9 Partially correct 0 ms 2024 KB Output is partially correct
10 Partially correct 0 ms 2024 KB Output is partially correct
11 Partially correct 0 ms 2024 KB Output is partially correct
12 Partially correct 0 ms 2024 KB Output is partially correct
13 Partially correct 0 ms 2024 KB Output is partially correct
14 Partially correct 0 ms 2024 KB Output is partially correct
15 Partially correct 0 ms 2024 KB Output is partially correct
16 Partially correct 0 ms 2024 KB Output is partially correct
17 Partially correct 0 ms 2024 KB Output is partially correct
18 Partially correct 0 ms 2024 KB Output is partially correct
19 Partially correct 0 ms 2024 KB Output is partially correct
20 Partially correct 0 ms 2024 KB Output is partially correct
21 Partially correct 0 ms 2024 KB Output is partially correct
22 Partially correct 0 ms 2024 KB Output is partially correct
23 Partially correct 0 ms 2024 KB Output is partially correct
24 Partially correct 0 ms 2024 KB Output is partially correct
25 Partially correct 0 ms 2024 KB Output is partially correct
26 Partially correct 0 ms 2024 KB Output is partially correct
27 Partially correct 0 ms 2024 KB Output is partially correct
28 Partially correct 0 ms 2024 KB Output is partially correct
29 Partially correct 0 ms 2024 KB Output is partially correct
30 Partially correct 0 ms 2024 KB Output is partially correct
31 Partially correct 0 ms 2024 KB Output is partially correct
32 Partially correct 0 ms 2024 KB Output is partially correct
33 Partially correct 0 ms 2024 KB Output is partially correct
34 Partially correct 0 ms 2024 KB Output is partially correct
35 Partially correct 0 ms 2024 KB Output is partially correct
36 Partially correct 0 ms 2024 KB Output is partially correct
37 Partially correct 0 ms 2024 KB Output is partially correct
38 Partially correct 0 ms 2024 KB Output is partially correct
39 Partially correct 0 ms 2024 KB Output is partially correct
40 Partially correct 0 ms 2024 KB Output is partially correct