Problem Statement   NOTE: This problem statement contains subscripts that may not display properly if viewed outside of the applet.
You're given a long[] R containing N elements. Count the number of sequences A_{0}, A_{1}, ..., A_{N1} such that each A_{i} is an integer satisfying 0 &le A_{i} &le R[i] and A_{0} + A_{1} + ... + A_{N1} = A_{0}  A_{1}  ...  A_{N1}. The '' symbol stands for bitwise OR of the operands. Return the number of such sequences modulo 1,000,000,009.   Definition   Class:  YetAnotherORProblem  Method:  countSequences  Parameters:  long[]  Returns:  int  Method signature:  int countSequences(long[] R)  (be sure your method is public) 
    Notes    If a and b are single bits then a  b is defined as max(a, b). For two integers, A and B, in order to calculate A  B, they need to be represented in binary: A = (a_{n}...a_{1})_{2}, B = (b_{n}...b_{1})_{2} (if the lengths of their representations are different, the shorter one is prepended with the necessary number of leading zeroes). Then A  B = C = (c_{n}...c_{1})_{2}, where c_{i} = a_{i}  b_{i}. For example, 10  3 = (1010)_{2}  (0011)_{2} = (1011)_{2} = 11.   Constraints    R will contain between 2 and 10 elements, inclusive.    Each element of R will be between 1 and 10^18, inclusive.   Examples  0)     Returns: 15  All the possible sequences are: {0,0}, {0,1}, {0,2}, {0,3}, {0,4}, {0,5}, {1,0}, {1,2}, {1,4}, {2,0}, {2,1}, {2,4}, {2,5}, {3,0}, {3,4}. 

 1)     2)     3)     4)    
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.
