SSU 495. Kids and Prizes(概率DP)
来源:互联网 发布:php单例模式 编辑:程序博客网 时间:2024/06/14 13:12
ICPC (International Cardboard Producing Company) is in the business of producing cardboard boxes. Recently the company organized a contest for kids for the best design of a cardboard box and selected M winners. There are N prizes for the winners, each one carefully packed in a cardboard box (made by the ICPC, of course). The awarding process will be as follows:
- All the boxes with prizes will be stored in a separate room.
- The winners will enter the room, one at a time.
- Each winner selects one of the boxes.
- The selected box is opened by a representative of the organizing committee.
- If the box contains a prize, the winner takes it.
- If the box is empty (because the same box has already been selected by one or more previous winners), the winner will instead get a certificate printed on a sheet of excellent cardboard (made by ICPC, of course).
- Whether there is a prize or not, the box is re-sealed and returned to the room.
Input
The first and only line of the input file contains the values of N and M (). Output
The first and only line of the output file should contain a single real number: the expected number of prizes given out. The answer is accepted as correct if either the absolute or the relative error is less than or equal to 10 -9. Example(s)
sample input
sample output
5 7
3.951424
sample input
sample output
4 3
2.3125
【题解】
写完之后才发现这道题自己以前写过。。。。
【代码链接】 点击打开链接
阅读全文
1 0
- SSU 495. Kids and Prizes(概率DP)
- SSU 495. Kids and Prizes(简单概率)
- SGU 495. Kids and Prizes(概率dp)
- Kids and Prizes(SGU495,概率DP)
- SGU 495 Kids and Prizes(概率dp)
- Sgu 495 Kids and Prizes (概率dp)
- sgu 495 Kids and Prizes 概率dp
- SGU 495 Kids and Prizes 概率dp
- 概率DP基础 SGU495 Kids and Prizes
- SGU 495 Kids and Prizes(概率dp)
- [概率dp] sgu 495 Kids and Prizes
- SGU495 Kids and Prizes 概率
- Kids and Prizes(概率+期望)
- SGU495 Kids and Prizes 概率DP,期望公式
- SGU 495 Kids and Prizes (概率DP)
- SGU 495 Kids and Prizes (概率DP)
- SGU 495 Kids and Prizes (概率DP入门)
- SGU-495 Kids and Prizes(概率DP)
- 大数据集群部署
- MemoryStream
- Linux权限解读
- 我做的游戏
- python实践,文件备份
- SSU 495. Kids and Prizes(概率DP)
- Java集合细节(一):请为集合指定初始容量
- File初步
- 【python】记自己第一个脚本计算器的诞生
- YOLO v2 在win10+GPU+VS2015下成功编译并演示
- Magic Powder
- 在Linux上搞了一天nginx
- A+B for Input-Output Practice (II) java
- 项目总结