답안 #201744

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
201744 2020-02-11T22:26:41 Z Leonardo_Paes Hotter Colder (IOI10_hottercolder) C++11
컴파일 오류
0 ms 0 KB
#incldue "grader.h"

int HC(int n){
    int ini = 1, fim = n , meio, ans = -1;
        
    while(ini<=fim){
        meio = (ini + fim) >> 1;
        
        if(ini == fim){
            ans = meio;
            break;
        }
        
        Guess(ini);
        int a = Guess(fim);
        
        if(a == 0){
            ans = meio;
            break;
        }
        else if(a == 1){
            ini = meio + 1;
        }
        else{
            fim = meio - 1 + (fim - ini)&1;
        }
    }

    return ans;
}

Compilation message

hottercolder.cpp:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
 #incldue "grader.h"
  ^~~~~~~
  include
hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:14:9: error: 'Guess' was not declared in this scope
         Guess(ini);
         ^~~~~
hottercolder.cpp:25:28: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
             fim = meio - 1 + (fim - ini)&1;
                   ~~~~~~~~~^~~~~~~~~~~~~