Submission #70605

#TimeUsernameProblemLanguageResultExecution timeMemory
70605mr_bananaScales (IOI15_scales)C++17
Compilation error
0 ms0 KiB
#include "scales.h"

void init(int T) {
    /* ... */
}
bool cmp(int x,int y){
    for(int i=0;i<3;i++){
        if(x!=i && y!=i){
            int ans=getLightest(x,y,i);
            if(ans==i){
                ans=getHeaviest(x,y,i);
                return ans==y;
            }
            else{
                return ans==x;
            }
        }
    }
}
void orderCoins() {
    int w[6]={1,2,3,4,5,6};
    sort(w,w+6,cmp);
    /*int ind1=getLightest(1,2,3),ind2=getLightest(4,5,6),ind3=getHeaviest(1,2,3),ind4=getHeaviest(4,5,6);
    int mx=getHeaviest(ind1,ind4,ind3);
    int ind5=6-ind1-ind3,ind6=15-ind2-ind4;
    int w[6];
    if(mn==ind3){
        int ans1=getNextLightest(ind1,ind3,ind5,ind2),ans2=getNextLightest(ind1,ind3,ind5,ind4),ans3=getNextLightest(ind1,ind3,ind5,ind6);

    }
    else{

    }*/
    answer(w);
}

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:3:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void orderCoins()':
scales.cpp:22:5: error: 'sort' was not declared in this scope
     sort(w,w+6,cmp);
     ^~~~
scales.cpp:22:5: note: suggested alternative: 'short'
     sort(w,w+6,cmp);
     ^~~~
     short
scales.cpp: In function 'bool cmp(int, int)':
scales.cpp:19:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^