QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#551247 | #9248. An Easy Math Problem | ucup-team4508# | TL | 0ms | 0kb | C++14 | 499b | 2024-09-07 16:09:18 | 2024-09-07 16:09:20 |
Judging History
This is the latest submission verdict.
- [2024-10-31 22:36:43]
- hack成功,自动添加数据
- (/hack/1098)
- [2024-10-31 22:13:58]
- hack成功,自动添加数据
- (/hack/1096)
- [2024-10-31 22:00:43]
- hack成功,自动添加数据
- (/hack/1095)
- [2024-09-07 16:09:18]
- Submitted
answer
#include<bits/stdc++.h>
using namespace std;
#define LL long long
LL n,i,j,k,m,t,cnt=0;
LL a[500005],b[500005];
int main(){
for(i=2;i<=100000;i++){
bool flag=false;
for(j=2;j<i;j++)
if(i%j==0){
flag=true;break;
}
if(flag==false) b[++cnt]=i;
}
scanf("%lld",&t);
while(t--){
LL ans=1;
scanf("%lld",&n);
for(j=1;j<=cnt;j++){
LL cnt1=0;
while(n%b[j]==0) cnt1++,n/=b[j];
ans*=(2*cnt1+1);
}
printf("%lld\n",(ans-1)/2+1);
}
return 0;
}
详细
Test #1:
score: 0
Time Limit Exceeded
input:
10 1 2 3 4 5 6 7 8 9 10