10 人解决,14 人已尝试。
20 份提交通过,共有 153 份提交。
6.4 EMB 奖励。
单点时限: 2.5 sec
内存限制: 256 MB
You are participating in a strange game. There are
At the beginning, you can sit on any chair. Then the jury will choose a color and announce it. Each color has
Of course, you will move to the nearest appropriate chair. If you are already sitting on it, you will not move at all.
You want to pick a chair to sit at the beginning to minimize the expected distance which you will have to walk.
你正在参加一场奇怪的游戏,绕着一个圆桌有
在游戏开始的时候,你可以坐在任何一张椅子上,之后裁判会选择并宣布一种颜色,每种颜色有
你当然会移动到最近的合适的椅子上,如果你已经坐在那种颜色椅子上,那就动都不用动了。
你想要选择一张开始时坐的椅子来最小化你需要走动的期望距离。
In the first line there are two integers
The second line contains
第一行包含两个正整数
第二行包含
保证
Output the expected distance as an irreducible fraction.
以最简分数输出期望距离。
5 3 1 1 2 3 1
2/3
5 5 1 2 3 4 5
6/5
你只能围绕着圆桌移动,按环上距离计算。
10 人解决,14 人已尝试。
20 份提交通过,共有 153 份提交。
6.4 EMB 奖励。