Submission #26714

# Submission time Handle Problem Language Result Execution time Memory
26714 2017-07-05T10:08:15 Z baactree Hotter Colder (IOI10_hottercolder) C++14
Compilation error
0 ms 0 KB
#include "grader.h"

int HC(int N){
    int le,ri;
    le=1;
    ri=N;
    while(true){
        int k=(n+2)/3;
        int g=Guess(k);
        int p=Guess(k*2);
        if(p==0){
            return (k*3)/2;
        }
        else if(p>0){
            le=(k*3)/2+1;
        }
        else{
            if(k&1)
                ri=(k*3)/2;
            else
                ri=(k*3)/2-1;
        }
        if(le==ri)
            return le;
    }
    return 0;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:8:16: error: 'n' was not declared in this scope
         int k=(n+2)/3;
                ^
hottercolder.cpp:9:13: warning: unused variable 'g' [-Wunused-variable]
         int g=Guess(k);
             ^