답안 #239454

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
239454 2020-06-15T16:28:50 Z DavidDamian Hotter Colder (IOI10_hottercolder) C++11
컴파일 오류
0 ms 0 KB
#include "grader.h"
///Subtask 2
///Binary Search
int HC(int N){
    int L=2,R=N;
    int ans=N;
    while(L<=R){
        if(L==R)
            return L
        int mid=(L+R)/2;
        int previous=Guess(mid-1);
        int act=Guess(mid);
        if(act==-1){
            ans=mid-1;
            R=mid-1;
        }
        else{
            L=mid+1;
        }
    }
    return ans;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:10:9: error: expected ';' before 'int'
         int mid=(L+R)/2;
         ^~~
hottercolder.cpp:11:13: warning: unused variable 'previous' [-Wunused-variable]
         int previous=Guess(mid-1);
             ^~~~~~~~