제출 #753496

#제출 시각아이디문제언어결과실행 시간메모리
753496amirrezashamsGuess the number (BOI20_guess)C++14
0 / 100
2530 ms208 KiB
#include <iostream> using namespace std; int main() { int a; cin >> a; int start = 1; int end = a; while(true) { int mid = (end+start)/2; cout << "? "<<mid<<endl; int r; cin >> r; if(r==0) { cout << "= "<<mid<<endl; return 0; break; } if(r==1) end = mid; if(r==-1) start = mid; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...