不能图省事写
for(;x;x-=lb(x))for(;y;y-=lb(y))
因为内层y是要循环popcnt(x)遍的。这么写的话之后y永远是0了。 应该写:
for(i=x;i<=N;i+=lowbit(i))for(j=y;j<=N;j+=lowbit(j))