This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
bool check(int t){
cout<<"? 1"<<endl;
int h;
cin>>h;
cout<<"? "<<t<<endl;
cin>>h;
return !h;
}
int main(){
int N;
cin>>N;
int x=0;
for(int b=N;b>=1;b/=2){
while(check(x+b))x+=b;
}
cout<<"= x"<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |