记录编号 | 357409 | 评测结果 | AAAAAAAAAA | ||
---|---|---|---|---|---|
题目名称 | 双亲数 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | C++ | 运行时间 | 0.412 s | ||
提交时间 | 2016-12-11 07:39:36 | 内存使用 | 7.92 MiB | ||
- #include<cstdio>
- typedef long long ll;
- const int maxn=1000005;
- ll f[maxn];
- int main(){
- freopen("parents.in","r",stdin);
- freopen("parents.out","w",stdout);
- int n,m,d;scanf("%d%d%d",&n,&m,&d);
- for(int i=1;i<=n;++i){
- f[i]=(n/i)*1LL*(m/i);
- }
- for(int i=n;i>=1;--i){
- for(int j=i+i;j<=n;j+=i)f[i]-=f[j];
- }
- printf("%lld\n",f[d]);
- fclose(stdin);fclose(stdout);
- return 0;
- }