제출 #1093756

#제출 시각아이디문제언어결과실행 시간메모리
1093756parsisorGuess the number (BOI20_guess)C++17
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int l = 1 , r = n; int resp = -1; while(l < r+1){ int mid = l + ( r - l)/2; if (resp != 0){ cout << "?" << mid << endl; } cerr << l << " " << r << endl; cin >> resp; if(resp == 0){ cout << "=" << mid << endl; } else if(resp == 1){ r = mid - 1; } else{ l = mid + 1; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...