LL ch(LL x)
{
LL ret = 0;
for(LL i=1; i<(1LL<<a[0]); i++)
{
int sum = 0, tmp = 1;
for(int j=0; j<a[0]; j++)
{
if(i & (1LL<<j))
{
sum++;
tmp *= a[j+1];
}
}
if(sum & 1)
ret += x/tmp;
else
ret -= x/tmp;
}
return ret;
}
容斥定理模板
猜你喜欢
转载自blog.csdn.net/miku531/article/details/81208251
今日推荐
周排行