当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5346:MZL's game

题目描述
MZL has $n$ cute boys.They are playing a game♂.The game will run in turn
First,System choose an alive player $x$ randomly.Player $x$ will be out of the game.
Then player x will attack all alive players in the game
When a player is attacked,$1-p$ is the probability of he still lives,$p$ is the probability of he dies
Now mzl wants to know:the probability of one player be out of the game and be attacked $k$ times

You need to print the probability mod 258280327 for every k from 0 to n-1

According to Fermat Theory,$\frac{x}{y}$ mod 258280327=x*$(y^{258280325})$ mod 258280327

$p$ will be given in a special way
输入解释
The first line of the input contains a single number $T$, the number of test cases.
Next $T$ lines, each line contains three integer $n$,$x$,$y$.$p=\frac{x}{y}$
$T\leq 5$, $n\leq 2*10^3$ $0 \leq x \leq 10^9$ $x+1 \leq y \leq 10^9$.
It is guaranteed that y and 258280327 are coprime.
输出解释
$T$ lines, every line n numbers: the ans from 0 to n-1
输入样例
2
3 33 100
9 23 233
输出样例
172186885 210128265 223268793
229582513 70878931 75916746 175250440 21435537 57513225 236405985 111165243 115953819
提示
for case 1:
  The probability of you live and not be attacked is 1/3
  The probability of you live and be attacked for one time is:
  (2/3)*(0.33*0.67+0.67*0.67*(1/2))=8911/30000
来自杭电HDUOJ的附加信息
Author SXYZ
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5346

最后修改于 2020-10-25T23:21:53+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 65536/65536K(Java/Others)