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 |
做的真是辛苦,看了下别人的预处理算法,很妙。预处理: F(n,k) 代表W形的以k开始的planks数目为n的Fence G(n,k) 代表M形的以k开始的planks数目为n的Fence F(n,k) = sigma(G(n-1, i)) (1 <= i <= k-1) G(n,k) = sigma(F(n-1, i)) (k <= i <= n-1) F(1,1) = G(1,1) = 1; G(n,k) = F(n,k) = 0 (k > n). Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator