fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define ll long long int
  5.  
  6. const int MAXN = 1e3 + 10; //dummy
  7.  
  8. class BinaryHeapLeaf{
  9. public:
  10. vector <int> maxDiff(int N){
  11. int mn = 0;
  12. int mx = 0;
  13. int curr2 = 1;
  14. int l = 0;
  15. int t = 2;
  16. while( curr2 <= N){
  17. curr2 += t;
  18. t *= 2;
  19. l++;
  20. }
  21. l--;
  22. vector<int> ans;
  23. mx = N - l;
  24. mn = (N + 1)/2;
  25. if( N == 2) mx = 1;
  26. ans.push_back(mn);
  27. ans.push_back(mx);
  28. return ans;
  29. }
  30. };
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