/// 18.09.2023 16:09
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n; cin >> n;
int l = 1, r = 1e6;
while(l <= r){
int mid = (l + r) / 2;
cout << "? " << mid << '\n';
int q; cin >> q;
if(!q){ cout << "= " << mid << '\n'; return 0; }
else if(q > 0) r = mid - 1;
else l = mid + 1;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
432 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
0 ms |
432 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |