Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:这题也是……比赛时2xxx ms过的……到这就改1000 ms Limit了……TLE…… 那位大大给讲讲算法?In Reply To:这题也是……比赛时2xxx ms过的……到这就改1000 ms Limit了……TLE…… 那位大大给讲讲算法? Posted by:150014 at 2007-05-01 16:45:27 C(n,k)=C((n-1),k))+C(n-1,k-1) C(n-1,k) = C(n-2,k)+C(n-2,k-1) C(n-1,k-1) = C(n-2,k-1)+C(n-2,k-2) C(n,k)= C(n-2,k)+C(n-2,k-1)*2+C(n-2,k-2) => C(n,k)= (C(n-2,k)+C(n-2,k-2))(mod 2) ..... => if k%2==0 C(n,k)= C(n-k,k)+1 (mod 2) if k%2==1&&n%2==0 C(n,k)= C(n-(k-1),k) (mod 2) if k%2==1&&n%2==1 C(n,k)= C(n-(k-1),k)+1 (mod 2) Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator