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. bool checkIfExist(vector<int>& A){
  12. int i;
  13. int j = 0;
  14. int N = A.size();
  15. sort(A.begin(), A.end());
  16. for(i=(0);i<(N);i++){
  17. while(j < N && A[j] < 2*A[i]){
  18. j++;
  19. }
  20. if(j==N){
  21. break;
  22. }
  23. if(j!=i && A[j]==2*A[i]){
  24. return true;
  25. }
  26. }
  27. return false;
  28. }
  29. }
  30. ;
  31. // cLay varsion 20200214-1
  32.  
  33. // --- original code ---
  34. // #define main dummy_main
  35. // {}
  36. // #undef main
  37. //
  38. // class Solution {
  39. // public:
  40. // bool checkIfExist(vector<int>& A) {
  41. // int i, j = 0;
  42. // int N = A.size();
  43. // sort(A.begin(), A.end());
  44. // rep(i,N){
  45. // while(j < N && A[j] < 2*A[i]) j++;
  46. // if(j==N) break;
  47. // if(j!=i && A[j]==2*A[i]) return true;
  48. // }
  49. // return false;
  50. // }
  51. // };
  52.  
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