#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; }
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account