| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1304096 | nathlol2 | Guess the number (BOI20_guess) | C++20 | 1 ms | 400 KiB |
#include <bits/stdc++.h>
using namespace std;
signed main(){
// ios_base::sync_with_stdio(false);
// cin.tie(NULL);
int n;
cin >> n;
int l = 1, r = n;
while(l <= r){
int md = (l + r) / 2;
cout << "? " << md << endl;
int t; cin >> t;
if(t == -1){
l = md + 1;
}else if(t == 1){
r = md - 1;
}else{
cout << "= " << md << endl;
return 0;
}
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
