fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int memo[1000000001];
  5.  
  6. int bytef(int n){
  7. int f;
  8. if(memo[n]!=-1)
  9. return memo[n];
  10. else if(n<=3)
  11. return n;
  12. else
  13. f = bytef(n/2)+bytef(n/3)+bytef(n/4);
  14. memo[n]=f;
  15. return f;
  16. }
  17.  
  18.  
  19.  
  20. int main(){
  21.  
  22. int res,n,t=10;
  23. for(int i=0;i<1000000001;i++)
  24. memo[i]=-1;
  25.  
  26. while(t--){
  27. cin>>n;
  28. res = bytef(n);
  29. }
  30.  
  31. if(res>n)
  32. cout<< res<<endl;
  33. else
  34. cout<<n<<endl;
  35. }
  36.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/L9rorW/cc6cykQo.o: In function `_GLOBAL__sub_I_memo':
prog.cpp:(.text.startup+0xd3): relocation truncated to fit: R_X86_64_PC32 against `.bss'
prog.cpp:(.text.startup+0xf1): relocation truncated to fit: R_X86_64_PC32 against `.bss'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty