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

建议使用的浏览器:

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

6389:Go to school

Special Judge 特殊评判
题目描述
Tongjiang wanna go back to UESTC from Xipu. He had arrived Xipu bus station at $(T=0)$.He would like take a bus or walk, for details, it takes $A$ minutes to take a bus while $B$ minutes to walk($A<B$ will be hold).There are $N$ bus lines all can take Tongjiang to UESTC, But as it was getting late,some bus lines may had already stopped running. Properly speaking, the bus line have a probability of $(1-\frac{L_i}{M})$ that it had already stopped running and no more bus will come to Xipu station, and a probability of $(\frac{L_i}{M}$) that there will be a bus come to Xipu station to take Tongjiang to UESTC. And in the second case the bus may arrive at bus station at any time $T$, which holds $(0 \leq T \leq Li)$, with equal probability. Tongjiang is a smart boy, he had $Q$ different strategy to wait bus. Under strategy $i$ He would set a latest time point $T_i$ first. Then he started waiting for bus and take the first bus come to station who can take him to school or when time come to $(T=T_i)$ and still no bus come, he would start walk to school.$\\$
Now, Tongjiang wonders under each strategy, what's the expect time he arrive at school.

For all bus line $i$, $( \frac{1}{3} M \leq L_i \leq \frac{2}{3} M )$

For all strategy $i$, $( Min(L_1,L_2...L_N) \leq T_i \leq Max(L_1,L_2...L_N) )$

$(6 \leq M \leq 100000)$

$(1 \leq A,B\leq 100000)$

$(2 \leq N \leq 12)$

$(1 \leq Q \leq 100000 )$
输入解释
First line five positive integer $N,Q,M,A$ and $B$.
Second line N positive integer $(L_1,L_2...L_N)$
Then $Q$ lines following,each line contains one integer means a latest time point $T_i$.
输出解释
For each strategy,print one line with you answer.
Your answer will be considered to be right if
$\min{\left\{\left|yourans-stdans\right|, \left|\frac{yourans-stdans}{stdans}\right|\right\}} < 10^{-4}$

$(min(abs(yourans-stdans),abs(\frac{yourans-stdans}{stdans})<1e-4)$.
输入样例
2 2 6 1 2
2 4
2
3
输出样例
2.851852
3.129630
来自杭电HDUOJ的附加信息
Recommend chendu

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

源链接: HDU-6389

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

共提交 0

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