fork download
  1. #pragma GCC optimize ("Ofast")
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. #define main dummy_main
  5. int main(){
  6. return 0;
  7. }
  8. #undef main
  9. class Solution{
  10. public:
  11. int minFlips(int a, int b, int c){
  12. int i;
  13. int x;
  14. int y;
  15. int z;
  16. int res = 0;
  17. for(i=(0);i<(31);i++){
  18. x = (a>>i) & 1;
  19. y = (b>>i) & 1;
  20. z = (c>>i) & 1;
  21. if(z==(x|y)){
  22. continue;
  23. }
  24. if(z==1){
  25. res++;
  26. }
  27. if(z==0){
  28. res += x + y;
  29. }
  30. }
  31. return res;
  32. }
  33. }
  34. ;
  35. // cLay varsion 20200119-1
  36.  
  37. // --- original code ---
  38. // #define main dummy_main
  39. // {}
  40. // #undef main
  41. //
  42. // class Solution {
  43. // public:
  44. // int minFlips(int a, int b, int c) {
  45. // int x, y, z;
  46. // int res = 0;
  47. // rep(i,31){
  48. // x = (a>>i) & 1;
  49. // y = (b>>i) & 1;
  50. // z = (c>>i) & 1;
  51. // if(z==(x|y)) continue;
  52. // if(z==1) res++;
  53. // if(z==0) res += x + y;
  54. // }
  55. // return res;
  56. // }
  57. // };
  58.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty