// log2n for(int ep2=2,i=0,j=0;i<maxn;i++){ if(i>ep2){ j++; ep2<<=1; } lg2[i]=j; } 转载于:https://www.cnblogs.com/amyc/articles/log2n.html