#abc216h. H - Random Robots
H - Random Robots
Score : points
问题描述
在数轴上有 个机器人。第 个机器人()最初位于坐标 处。
接下来,将精确进行 次如下过程:
- 每个机器人以概率 独立选择移动或不移动。选择移动的机器人会 同时 向正方向移动距离 ,而其他机器人则保持静止。
此处,所有概率性决策都是独立的。
求在整个过程中,没有两个机器人相遇的概率,即在整个过程中任何时候都没有两个或更多机器人处于相同坐标的概率,结果对 取模(参见注释)。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are robots on a number line. The -th robot is initially at the coordinate .
The following procedure is going to take place exactly times.
- Each robot chooses to move or not with probability each. The robots that move will simultaneously go the distance of in the positive direction, and the other robots will remain still.
Here, all probabilistic decisions are independent.
Find the probability that no two robots meet, that is, there are never two or more robots at the same coordinate at the same time throughout the procedures, modulo (see Notes).
Notes
It can be proved that the probability in question is always a rational number. Additionally, under the Constraints in this problem, when that value is represented as using two coprime integers and , it can be proved that there uniquely exists an integer such that and . Find this .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 2
1 2
Sample Output 1
374341633
The probability in question is .
We have , so you should print .
Sample Input 2
2 2
10 100
Sample Output 2
1
The probability in question may be .
Sample Input 3
10 832
73 160 221 340 447 574 720 742 782 970
Sample Output 3
553220346
update @ 2024/3/10 09:35:50