15 solutions

  • 0
    @ 2022-1-19 10:06:22
    #include<bits/stdc++.h>
    #define ll long long 
    using namespace std;
    int main()
    {
    	ll n;
    	ll qwq=1;
    	cin>>n;
    	for(int i=2;i*i<=n;i++)
    	{
    		int num=0;
    		while(n%i==0)
    		{
    			n/=i;
    			num++;
    		}
    		if(num%2!=0)
    		qwq*=i;
    	}
    	cout<<qwq*n;
    	return 0;
    }
    

    Information

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