fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define ll long long
  5. #define lli long long
  6. #define rep(i,a,b) for(int i=a;i<b;i++)
  7.  
  8. ll hcf(ll a,ll b){
  9. if(a%b){
  10. return hcf(b,a%b);
  11. }
  12. else{
  13. return b;
  14. }
  15. }
  16.  
  17. using namespace std;
  18. int main () {
  19. ll n;
  20. cin>>n;
  21. ll ans=0;
  22. lli a=1;
  23. for(;a*a*a*a<=n;a++){
  24.  
  25. for(;a*b*b*b<=n;b++){
  26.  
  27. lli b=a+1;
  28. lli h1=hcf(a,b);
  29. if(h1!=1){
  30. continue;
  31. }
  32. lli c=b+1;
  33. for(;a*b*c*c<=n;c++){
  34.  
  35. lli h2=hcf(h1,c);
  36. if(h2!=1){
  37. continue;
  38. }
  39. ll d=c+1;
  40. for(;a*b*c*d<=n;d++){
  41. if(hcf(h2,d)!=1){
  42. continue;
  43. }
  44. else{
  45. ans++;
  46.  
  47. }
  48. }
  49. }
  50.  
  51. }
  52.  
  53. }
  54.  
  55. cout<<ans<<endl;
  56.  
  57.  
  58.  
  59.  
  60. return 0;
  61. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:25:16: error: ‘b’ was not declared in this scope
         for(;a*b*b*b<=n;b++){
                ^
stdout
Standard output is empty