fork download
  1. #pragma GCC optimize("Ofast")
  2. #pragma GCC optimize("unroll-loops")
  3. #pragma GCC optimize("inline")
  4. #include<bits/stdc++.h>
  5. using namespace std;
  6. #define main dummy_main
  7. int main(){
  8. return 0;
  9. }
  10. #undef main
  11. class Solution{
  12. public:
  13. int findKOr(vector<int> &A, int K){
  14. int j;
  15. int res = 0;
  16. int c[31] = {};
  17. int N = A.size();
  18. for(int x : A){
  19. int j;
  20. for(j=(0);j<(31);j++){
  21. if(((x) &(1<<(j)))){
  22. c[j]++;
  23. }
  24. }
  25. }
  26. for(j=(0);j<(31);j++){
  27. if(c[j] >= K){
  28. res |=(1<<(j));
  29. }
  30. }
  31. return res;
  32. }
  33. }
  34. ;
  35. // cLay version 20231031-1
  36.  
  37. // --- original code ---
  38. // #define main dummy_main
  39. // {}
  40. // #undef main
  41. //
  42. // class Solution {
  43. // public:
  44. // int findKOr(VI &A, int K) {
  45. // int res = 0, c[31] = {}, N = A.size();
  46. // for(int x : A) rep(j,31) if(BIT_ith(x,j)) c[j]++;
  47. // rep(j,31) if(c[j] >= K) res |= BIT_ith(j);
  48. // return res;
  49. // }
  50. // };
  51.  
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