제출 #642311

#제출 시각아이디문제언어결과실행 시간메모리
642311cigneveGuess the number (BOI20_guess)C++14
0 / 100
2456 ms208 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int N,input=INT_MAX; cin >> N; int l=1,r=N; while (input!=0){ printf("? %d\n",(r-l)/2+l); cin >> input; if (input==1){ l=(r-l)/2+l; } else if (input==-1){ r=(r-l)/2+l; } } printf("= %d",(r-l)/2+l); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...