QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#641063#9248. An Easy Math ProblemTytytony#WA 4ms5696kbC++23611b2024-10-14 18:14:022024-10-14 18:14:02

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 18:14:02]
  • Judged
  • Verdict: WA
  • Time: 4ms
  • Memory: 5696kb
  • [2024-10-14 18:14:02]
  • 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=0;
		for(int i=1;i<=m;i++) tmp*=c[i]+1;
		for(int i=1;i<=m;i++){
			ans+=tmp/(c[i]+1)-1;
			ans+=c[i];
		}
		cout<<++ans<<endl;
	}
	return 0;

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 5696kb

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: -100
Wrong Answer
time: 4ms
memory: 5616kb

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:

5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
5121
...

result:

wrong answer 1st lines differ - expected: '29525', found: '5121'