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. vector<int> minSubsequence(vector<int>& A){
  12. int i;
  13. int tot;
  14. int now = 0;
  15. int N = A.size();
  16. vector<int> res;
  17. sort(A.begin(), A.end());
  18. {
  19. int Lj4PdHRW;
  20. int KL2GvlyY;
  21. if(N==0){
  22. KL2GvlyY = 0;
  23. }
  24. else{
  25. KL2GvlyY = A[0];
  26. for(Lj4PdHRW=(1);Lj4PdHRW<(N);Lj4PdHRW++){
  27. KL2GvlyY += A[Lj4PdHRW];
  28. }
  29. }
  30. tot =KL2GvlyY;
  31. }
  32. for(i=(N)-1;i>=(0);i--){
  33. if(now <= tot){
  34. res.push_back(A[i]);
  35. now += A[i];
  36. tot -= A[i];
  37. }
  38. }
  39. return res;
  40. }
  41. }
  42. ;
  43. // cLay varsion 20200408-1
  44.  
  45. // --- original code ---
  46. // #define main dummy_main
  47. // {}
  48. // #undef main
  49. //
  50. // class Solution {
  51. // public:
  52. // vector<int> minSubsequence(vector<int>& A) {
  53. // int tot, now = 0, N = A.size();
  54. // vector<int> res;
  55. // sort(A.begin(), A.end());
  56. //
  57. // tot = sum(A(N));
  58. // rrep(i,N) if(now <= tot){
  59. // res.push_back(A[i]);
  60. // now += A[i];
  61. // tot -= A[i];
  62. // }
  63. //
  64. // return res;
  65. // }
  66. // };
  67.  
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