95pts求救
查看原帖
95pts求救
495908
llycdasanbing楼主2022/10/17 21:52
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

ll q,zys[100],times[100];
ll fjzys(ll x)
{
	ll geshu=0,zgs=0;
	for(ll i=2;i<=sqrt(x);i++)
	{
		if(x%i==0)
		{
			geshu++;
			zys[geshu]=i;
			while(x%i==0)
			{
				times[geshu]++;
				x/=i;
			}
		}
		zgs+=times[geshu];
	}
	if(x!=1)
	{
		geshu++;
		zys[geshu]=x;
		times[geshu]=1;
		zgs++;
	}
	return zgs;
}
int main()
{
	ll zsgs;
	cin >> q;
	zsgs=fjzys(q);
	if(zsgs==2)
	{
		cout << 2;
	}
	else if(zsgs==1)
	{
		cout << "1\n0";
	}
	else 
	{
		if(times[1]>=2)
		{
			cout << "1\n" << zys[1]*zys[1]; 
		}
		else cout << "1\n" << zys[1]*zys[2];
	}
}

这玩意11点过不去了,请教一下(据说是个大数据)

2022/10/17 21:52
加载中...