Submission #52928

#TimeUsernameProblemLanguageResultExecution timeMemory
52928rondojimScales (IOI15_scales)C++17
55.56 / 100
3 ms796 KiB
#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)

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp: In function 'void init(int)':
scales.cpp:6:15: warning: unused parameter 't' [-Wunused-parameter]
 void init(int t){
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...