Pro.ID10159 TitleStringsobits Title链接http://10.20.2.8/oj/exercise/problem?problem_id=10159 AC8 Submit43 Ratio18.60% 时间&空间限制描述Consider an ordered set S of strings of N (1 ≤ N ≤ 31) bits. Bits, of course, are either 0 or 1. This set of strings is interesting because it is ordered and contains all possible strings of length N that have L (1 ≤ L ≤ N) or fewer bits that are '1'. Your task is to read a number I ( 1 ≤ I ≤ sizeof(S) ) from the input and print the Ith element of the ordered set for N bits with no more than L bits that are '1'. 输入Multiple test cases. For each case, there is a single line with three space separated integers: N, L, and I. 输出Description Consider an ordered set S of strings of N (1 ≤ N ≤ 31) bits. Bits, of course, are either 0 or 1. This set of strings is interesting because it is ordered and contains all possible strings of length N that have L (1 ≤ L ≤ N) or fewer bits that are '1'. Your task is to read a number I ( 1 ≤ I ≤ sizeof(S) ) from the input and print the Ith element of the ordered set for N bits with no more than L bits that are '1'. Input Multiple test cases. For each case, there is a single line with three space separated integers: N, L, and I. Output For each case, output a single line containing the integer that represents the I-th element from the order set, as described. Sample Input 5 3 19 Sample Output 10011 Source 样例输入5 3 19 样例输出10011 作者 |