| 记录编号 | 527151 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 2521.[HZOI 2016]首遇lancer | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.004 s | ||
| 提交时间 | 2019-02-12 08:29:17 | 内存使用 | 3.16 MiB | ||
#include<bits/stdc++.h>
using namespace std;
int n,ans,tot;
int jishu1(int n){
int ans=0;
int y=sqrt(n);
for(int j=1;j<=y;j++){
if(n%j==0)ans+=2;
}
if(y*y==n)ans--;
return ans;
}
int jishu2(int n){
int r=sqrt(n);
for(int i=1;i<=r;i++){
if(n%i==0){
tot=jishu1(i)+jishu1(n/i)+tot;
}
}
if(r*r==n)tot-=jishu1(r);
return tot;
}
int main()
{
freopen("lancer.in","r",stdin);
freopen("lancer.out","w",stdout);
cin>>n;
cout<<jishu2(n);
return 0;
}