fork download
  1. // bool query(int x) { return X <= x; } の場合。
  2. int solve()
  3. {
  4. int b=1<<30;
  5. int ans=b-1;
  6. while(b){
  7. if(query(ans-b))ans-=b;
  8. b/=2;
  9. }
  10. return ans;
  11. }
  12.  
  13. // bool query(int x){return x<=X; } の場合。
  14. int solve()
  15. {
  16. int b=1<<30;
  17. int ans=0;
  18. while(b){
  19. if(query(ans+b))ans+=b;
  20. b/=2;
  21. }
  22. return ans;
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘solve’:
prog.c:7: warning: implicit declaration of function ‘query’
prog.c: At top level:
prog.c:14: error: redefinition of ‘solve’
prog.c:3: error: previous definition of ‘solve’ was here
stdout
Standard output is empty