15 solutions

  • 0
    @ 2022-1-18 17:12:02

    打卡

    #include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    ll n,fg,ans=1;
    int main()
    {
    	cin>>n;
    	for(ll i=2;i*i<=n;++i)
    	{
    		fg=0;
    		while(n%i==0)
    		{
    			fg++;
    			n/=i;
    		}
    		if(fg%2!=0) ans*=i;
    	}
    	ans*=n;
    	cout<<ans<<"\n";
    	
    	return 0;
     } 
    

    Information

    ID
    189
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    8
    Tags
    # Submissions
    493
    Accepted
    91
    Uploaded By