A. Two Subsequences
Solution:
Obviously the string a will only have one letter. We only need to find the smallest letter in the original string.
Code:
Java
C++
B. Divine Array
Solution:
Solve it by brute force until all the numbers no longer change. The reason for the value change is: in the last change, there were two numbers which the number of it are the same.
So obviously, after this operation is performed up to 2000 times, all numbers will become the same number.
Code:
Java
C++
C. Array Elimination
Solution:
Obviously, if you want to delete 1 in a certain bit, then the k selected numbers are all 1 in that bit. At the same time, after each operation, all 1s in this bit will become 0. Therefore, k must be able to divide the number of numbers which the certain bit is 1 and your want to remove it.
Therefore, count the numbers for each bit where the certain bit is 1 and take the greatest common divisor.
Code:
Java
C++
D. Frog Traveler
The key point of this problem is to convert slippage into a part of jumping operation.