#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int l=0,r=n;
while(1)
{
int m=(r+l)/2,x;
cout<<"? "<<m<<endl;
cin>>x;
if(x==1)
{
l=m;
}
else if(x==0)
{
cout<<"= "<<m;
break;
}
else
{
r=m;
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Runtime error |
0 ms |
432 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Runtime error |
0 ms |
432 KB |
Execution killed with signal 13 |
3 |
Halted |
0 ms |
0 KB |
- |