SHARE
TWEET

Untitled

a guest Mar 20th, 2016 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // #include "testlib.h"
  3. #include <bits/stdc++.h>
  4.  
  5. using namespace std;
  6.  
  7. void Go( int s , int e )
  8. {
  9.     int m = (s+e) / 2;
  10.     cout<<m<<"\n";
  11.     cout.flush();
  12.    
  13.     int r; cin>>r;
  14.     if ( r==1 ) return;
  15.     if ( r==2 ) Go( s , m-1 );
  16.     if ( r==0 ) Go( m+1 , e );
  17. }
  18.  
  19. int main()
  20. {
  21.     Go(1 , 1000);
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top