15 solutions

  • 0
    @ 2022-1-18 15:50:20

    #打卡

    #include<iostream>
    #include<algorithm>
    #include<cstring>
    #include<cmath>
    #include<vector>
    #include<map>
    #include<stack>
    #define ll long long
    using namespace std;
    int main(){
    	ios::sync_with_stdio(false);
    	ll n,an,ans=1;
    	cin>>n;
    	for(int i=2;i*i<=n;i++){
    		an=0;
    		while(n%i==0){
    			an++;
    			n=n/i;
    		}
    		if(an%2!=0) ans*=i;
    	}
    	ans*=n;
    	cout<<ans<<endl;
    	return 0;
    }
    

    Information

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