Saturday, January 24, 2015

We know Fibonacci series (Fibonacci sequence): 1, 1, 2, 3, 5, 8, .... We now use a similar concept


We know Fibonacci series (Fibonacci sequence): 1, 1, 2, 3, 5, 8, .... We now use a similar concept to define a string, as follows: BFS (0) = 0 BFS (1) = 1 (here, "0" and "1" deoxyribonucleic acid as a string, not a number between 0 and 1) for all n> 1, BFS (n) = BFS (n-1) + BFS (n-1), where the + symbol indicates a merger of the two strings so we define a new string sequence: 0, 1, 01 , 101, 01101, .... Please write a program to identify the sequence of the N-th string, and outputs the i-th character of the string to the first j characters (numbers N, i, j's begin with 0). Input data input of the first column has an integer T (T <= 100) represents the number of sets of test data, each set of data there are three integers N, i, j (0 <= N, i, j <2 ^ 31 and i <= j and j - i <= 10000), to ensure that the information is not out of range (ie 0 <= i, j <BFS (N) string length). Output For each test case, please output BFS (N) in the string from position i ~ j. Sample Input 3 3 1 2 1 0 0 9 5 12 Sample Output 01 1 10101101 ORIGINAL
# 100 ~ 199 (22) # 200 ~ 299 (21) # 300 ~ 399 (23) # 400 ~ 499 (23) # 500 ~ 599 (11) # 600 ~ 699 (3) # 700 ~ 799 (9) # 800 ~ 899 (13) # 900 ~ 999 (11) Volume 100XX (6) Volume deoxyribonucleic acid 101XX (2) Volume 102XX (3) Volume 103XX (1) Volume 104XX (4) Volume 105XX (2) Volume 106XX (4) Volume 107XX (2) Volume 108XX (3) Volume 109XX (3) Volume 110XX (2) Volume 111XX (5) Volume 112XX (24) Volume 113XX (11) Volume 114XX (11) Volume 115XX (43) Volume 116XX (13) Volume 117XX (12) Volume 118XX (18) Volume 119XX (42) Volume 120XX (18)


No comments:

Post a Comment