记录编号 | 129931 | 评测结果 | AAAAAAAAAA | ||
---|---|---|---|---|---|
题目名称 | 双亲数 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | C++ | 运行时间 | 0.906 s | ||
提交时间 | 2014-10-21 15:08:17 | 内存使用 | 10.88 MiB | ||
- #include<cstdio>
- using namespace std;
- int d;
- long long A,B;
- long long f[2000001];
- int main()
- {
- freopen("parents.in","r",stdin);
- freopen("parents.out","w",stdout);
- scanf("%lld%lld%d",&A,&B,&d);
- if(A>B)
- {
- long long c=A;
- A=B;B=c;
- }
- for(int k=A;k>=1;k--)
- {
- f[k]=(A/k)*(B/k);
- for(int j=2;j<=A/k;j++) f[k]-=f[k*j];
- }
- printf("%lld",f[d]);
- return 0;
- }