LL polya(LL m,LL n)
{
LL result=0;
for(int i=1;i<=n;i++)
result+=Pow(m,gcd(n,i));
if(n%2)
result+=Pow(m,(n+1)/2)*n;
else
result+=(Pow(m,n/2)+Pow(m,n/2+1))*n/2;
return result/n/2;
}
暴力polya模版
最新推荐文章于 2020-05-07 11:56:58 发布