제출 #255202

#제출 시각아이디문제언어결과실행 시간메모리
255202a_playerGuess the number (BOI20_guess)C++14
0 / 100
0 ms256 KiB
#include <bits/stdc++.h>

using namespace std;

bool check(int t){
    cout<<"? "<<t<<endl;
    int h;
    cin>>h;
    if(h==0){
        cout<<"= "<<t<<endl;
        exit(0);
    }
    return h<1;
}

int main(){
    int N;
    cin>>N;
    int x=-1;
    for(int b=N;b>=1;b/=2)
    while(check(x+b))x+=b;
    cout<<"= "<<x<<endl;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...