QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#490275#6566. Power of DivisorsSmallAoPigBigPiPig#WA 0ms3840kbC++14766b2024-07-25 13:55:142024-07-25 13:55:15

Judging History

你现在查看的是最新测评结果

  • [2024-07-25 13:55:15]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3840kb
  • [2024-07-25 13:55:14]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long x;
	cin>>x;
	long long Anss=-1;
	for(int i=100;i>=3;i--){
		long long Ans=-1;
		for(int j=2;;j++){
			int tot=0; long long w=x; 
			bool flg=true;
			for(;w>1;w/=j,++tot)
			 if(w%j) flg=false;
			if(tot<i) break;
			if(tot==i&&flg) Ans=j;
		}
		if(Ans!=-1){
			long long w=Ans,v=1;
			for(int j=2;j<=w;j++)
			 if(w%j==0){
			 	long long k=0;
			 	for(;w>1;++k,w/=j)
			 	 if(w%j) break;
				v=v*(k+1); 
				if(v>i) break;
			 }
			if(v==i){
				Anss=Ans;
				break;
			}
		}
	}
	if(Anss==-1){
		long long Ans=sqrt(x);
		bool flg=false;
		for(int i=2;1ll*i*i<=Ans;i++)
		 if(Ans%i==0) flg=true;
		if(!flg) Anss=Ans;
	}
	printf("%lld\n",Anss);
	return 0;
} 

詳細信息

Test #1:

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

input:

15625

output:

25

result:

ok single line: '25'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

64000000

output:

20

result:

ok single line: '20'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3840kb

input:

65536

output:

-1

result:

ok single line: '-1'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

1

output:

1

result:

ok single line: '1'

Test #5:

score: -100
Wrong Answer
time: 0ms
memory: 3680kb

input:

10

output:

3

result:

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