打卡
#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; }
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