fork download
  1. #include "bits/stdc++.h"
  2. using namespace std ;
  3.  
  4. void sol( ){
  5. int lo = 1, hi = 1000000, ans = -1 ;
  6. char op ;
  7. while( lo <= hi ){
  8. int mid = lo + hi >> 1 ;
  9. cout << 1 << " " << mid << endl ;
  10. cin >> op ;
  11. if( op == -1 ){
  12. return ;
  13. }
  14. if( op == '<' ){
  15. ans = mid ;
  16. lo = mid+1 ;
  17. }
  18. else{
  19. hi = mid-1 ;
  20. }
  21. }
  22. cout << 0 << " " << ans << endl ;
  23. }
  24.  
  25. signed main( ){
  26. sol( ) ;
  27. }
  28. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:28:1: error: expected declaration before ‘}’ token
 }
 ^
stdout
Standard output is empty