#P5363. [SDOI2019] 移动金币
[SDOI2019] 移动金币
Description
Alice and Bob are going to play the following game. They take turns, and Alice moves first.
When it is a player's turn, they may choose one coin and move it any number of cells to the left, but at least cell. A coin cannot be moved out of the board, and it cannot pass over other coins.
Initially, there are coins placed on a board. Each coin occupies a distinct cell, and each cell contains at most one coin.
If, on a player's turn, they can no longer make any valid move (obviously, at this time the coins are exactly in the leftmost cells), then that player is judged to lose. It is known that Alice and Bob are both extremely smart, and they can always make the optimal move in any position. So, how many initial states can guarantee that Alice, as the first player, will win?
Input Format
The input contains only one line with two positive integers, and , in this order, as described in the statement.
Output Format
Output one integer, the number of initial states that can guarantee Alice, as the first player, will win. Since the answer may be very large, output it modulo .
10 3
100
199 43
981535230
99999 47
39178973
Hint
Subtask ( points): and .
Subtask ( points): and .
Translated by ChatGPT 5
京公网安备 11011102002149号