QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#641216#9248. An Easy Math ProblemTytytony#TL 4ms5660kbC++23636b2024-10-14 19:13:152024-10-14 19:13:16

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-10-14 19:13:16]
  • Judged
  • Verdict: TL
  • Time: 4ms
  • Memory: 5660kb
  • [2024-10-14 19:13:15]
  • Submitted

answer

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#define ll long long
#define N 1000010
using namespace std;

ll n,m;
ll p[N],c[N];
ll tmp,ans;

void divide(ll nn){
	m=0;
	for(int i=2;i*i<=nn;i++){
		if(nn%i==0){
			p[++m]=i,c[m]=0;
			while(nn%i==0) nn/=i,c[m]++;
		}
	}
	if(nn>1)
	    p[++m]=nn,c[m]=1;
}

int main(){
	int T; cin>>T;
	while(T--){
		cin>>n;
		divide(n);
		tmp=1,ans=1;
		p[0]=1,c[0]=1;
		for(int i=1;i<=m;i++) tmp*=c[i]+1;
		for(int i=1;i<=m;i++){
			ans*=(2*c[i]+1);
		}
		
		
		ans=(ans-1)/2+1;
		cout<<ans<<endl;
	}
	return 0;

}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 5660kb

input:

10
1
2
3
4
5
6
7
8
9
10

output:

1
2
2
3
2
5
2
4
3
5

result:

ok 10 lines

Test #2:

score: 0
Accepted
time: 4ms
memory: 5648kb

input:

2000
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
6469693230
646969323...

output:

29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
29525
...

result:

ok 2000 lines

Test #3:

score: -100
Time Limit Exceeded

input:

2000
1763047095
79735483
1016286871
2864801397
2327774116
2668010360
3469893354
3634459021
1613699068
781737219
574741575
2763134701
1458502604
1822260248
2281150332
2924219311
2493931196
3735904708
158802001
2006921221
729928782
1974841034
727412600
2873393292
1291087179
2741607663
1893408215
29827...

output:

14
5
2
5
23
95
68
14
8
68
203
14
23
32
38
41
8
8
14
2
608
41
158
338
23
41
14
5
14
41
14
203
41
14
17
446
5
53
59
878

result: