I am preparing for INOI and am stuck on this problem here: http://acm.timus.ru/problem.aspx?space=1&num=1081 I am just a beginner with DP so I am not getting any idea on how we will solve this question. Can anyone explain me the proper logic of the solution to this problem instead of just giving the code? asked 06 Jan '15, 11:10

Hi, (Let's call the least significant element to be element number 0.) For each element, starting with element number 0, you can calculate the number of sequences starting from there, that begin with a 0, and those that begin with a 1. Basically, Once you've such a table, calculating the Cheers! answered 06 Jan '15, 13:17
I need a proper explanation but thanks!
(06 Jan '15, 13:20)
@ketanhwr  proper enough?
(06 Jan '15, 13:57)
