P7464 [CERC2018] The Silence of the Lamps
Silence_World · · 题解
思路
很水的一道题啊,我们观察
代码
#include<bits/stdc++.h>
using namespace std;
#define int long long
int sum[10000005];
signed main(){
int t;
cin>>t;
for(int i=1;i<=1000005;i++){
for(int j=i+1;j*i<=1000005;j++){
for(int k=j+1;i*j*k<=1000005;k++){
sum[i*j*k]++;
}
}
}
for(int i=1;i<=1000005;i++)sum[i]=sum[i-1]+sum[i];
while(t--){
int n;
cin>>n;
cout<<sum[n]<<endl;
}
}