|
||||||||||
Counting GameTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 297 Accepted Submission(s): 106 Problem Description Let's define the number of '1' of X in base 2 is V(X).Now give you an X and a k, please give me the kth number Y strictly greater than X and V(X) = V(Y). Input Input includes several cases. Each case contains one line with two integers X, k. Input ends with a case X = 0 and k = 0. X is a 32-bit integer, 0 < K <= 50000. Output Every case print a integer Y in a line. Y is guaranteed to be a 32-bit integer. Sample Input
Sample Output
Author CTW Source | ||||||||||
|