Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // #include "testlib.h"
- #include <bits/stdc++.h>
- using namespace std;
- void Go( int s , int e )
- {
- int m = (s+e) / 2;
- cout<<m<<"\n";
- cout.flush();
- int r; cin>>r;
- if ( r==1 ) return;
- if ( r==0 ) Go( s , m-1 );
- if ( r==2 ) Go( m+1 , e );
- }
- int main()
- {
- Go(1 , 1000);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement