Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long int
- #define pb push_back
- #define mp make_pair
- #define F first
- #define S second
- int main()
- {
- //ios_base::sync_with_stdio(0); cin.tie(0);
- int L=0,R=1000000,ans;
- while(L<=R){
- int m=(L+R)/2;
- cout<<m<<endl;
- string resp; cin>>resp;
- if(resp=="<") R=m-1;
- else{
- ans=m;
- L=m+1;
- }
- }
- cout<<"! "<<ans<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement