15 solutions

  • 0
    @ 2022-1-18 16:49:33
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	long long n;
    	cin>>n;
    	long long ans=1;
    	for(long long i=2;i<=n;i++){
    		int num=0;
    		while(n%i==0){
    			n=n/i;
    			num++;
    			
    		}
    		if(num%2!=0){
    			ans=ans*i;
    		}
    	}
    	cout<<ans;
    	return 0;
    }
    

    Information

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