This commit is contained in:
ljcjames 2022-08-18 22:57:16 +08:00
parent ec01eb6a32
commit a455799695
8 changed files with 102 additions and 1 deletions

View File

@ -0,0 +1,12 @@
# 题目
* 链接
### 题意
### 做法
### 关键词
### 易错点
*
### 工具箱
*

View File

@ -0,0 +1 @@
#

View File

@ -0,0 +1,65 @@
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
const int N=1e7+5,M=7e5+5;
int pr[M];//´æÖÊÊý
bool b[N];//ÊDz»ÊÇÖÊÊý
int cnt=0;
inline void prime()
{
for(int i=2;i<N;i++)
{
if(!b[i])
{
pr[++cnt]=i;
}
for(int j=1;j<=cnt&&pr[j]*i<N;j++)
{
b[pr[j]*i]=1;
if(i%pr[j]==0)
{
break;
}
}
}
}
int main()
{
int t;
int t1 = 0;
long long n;
int len;
int now;
int ans;
prime();
scanf("%d", &t);
while (t--)
{
ans = 1;
scanf("%lld", &n);
len = sqrt(n);
for (int i = 1; pr[i] <= len&&pr[i]; i++)//re
{
if (n % pr[i] == 0)
{
now = 0;
while (n % pr[i] == 0)
{
n /= pr[i];
now++;
}
ans *= (2*now+1);
}
}
if (n > 1)
{
ans *= 3;
}
ans=ans/2+1;
printf("Case %d: %d\n", ++t1, ans);
}
return 0;
}

View File

View File

@ -0,0 +1,16 @@
15
2
3
4
6
8
10
12
15
18
20
21
24
25
27
29

View File

View File

@ -0,0 +1,7 @@
## z:\Chao\src\Template\test\in.txt
2020/03/14 ÖÜÁù 11:41:28.68
Hello Easy C++ project!
-----------------------------------------------
Process exited after 200 ms with return value 0

View File

@ -17,7 +17,7 @@ int main()
{
}
printf("Case %d: %d",++t1,n);
printf("Case %d: %d\n",++t1,n);
}
return 0;
}