QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#551247#9248. An Easy Math Problemucup-team4508#TL 0ms0kbC++14499b2024-09-07 16:09:182024-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:20]
  • Judged
  • Verdict: TL
  • Time: 0ms
  • Memory: 0kb
  • [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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:

10
1
2
3
4
5
6
7
8
9
10

output:


result: