摘要:        
LL ksm(LL a,LL b) //b为幂{ LL tmp=1; for(;b;a=a*a,b>>=1) { if(b&1) tmp*=a; } return tmp;}乘法次数为:b的二进制长度-2+1的个数    阅读全文
        
            posted @ 2013-04-27 21:14
小仪在努力~
阅读(119)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
int anr(int n,int r) { //求n的r排列 int res=1; for(int i=0;i<r;i++) res*= n-i; return res;}int cnr(int n,int r) { //求n的r组合 int res = anr(n,r); for(;r;r--) res /= r; return res;}//{1,2,3,--,n}的r组合a[i](i=1 to r)在其所有r组合中的字典序号int c_lexorder(int *a,int n,int r) { int res = cnr(n,r); f...    阅读全文
        
            posted @ 2013-04-27 17:58
小仪在努力~
阅读(172)
评论(0)
推荐(0)
        
        
                    
                
浙公网安备 33010602011771号