// bool query(int x) { return X <= x; } の場合。int solve(){ int b=1<<30; int ans=b-1; while(b){ if(query(ans-b))ans-=b; b/=2; } return ans;} // bool query(int x){return x<=X; } の場合。int solve(){ int b=1<<30; int ans=0; while(b){ if(query(ans+b))ans+=b; b/=2; } return ans;}
Standard input is empty
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
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!