当前位置:网站首页>poj2096 Collecting Bugs
poj2096 Collecting Bugs
2022-08-08 13:22:00 【51CTO】
http://www.elijahqi.win/archives/3622
Description
Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he classifies all possible bugs into n categories. Each day he discovers exactly one bug in the program and adds information about it and its category into a spreadsheet. When he finds bugs in all bug categories, he calls the program disgusting, publishes this spreadsheet on his home page, and forgets completely about the program.
Two companies, Macrosoft and Microhard are in tight competition. Microhard wants to decrease sales of one Macrosoft program. They hire Ivan to prove that the program in question is disgusting. However, Ivan has a complicated problem. This new program has s subcomponents, and finding bugs of all types in each subcomponent would take too long before the target could be reached. So Ivan and Microhard agreed to use a simpler criteria — Ivan should find at least one bug in each subsystem and at least one bug of each category.
Macrosoft knows about these plans and it wants to estimate the time that is required for Ivan to call its program disgusting. It’s important because the company releases a new version soon, so it can correct its plans and release it quicker. Nobody would be interested in Ivan’s opinion about the reliability of the obsolete version.
A bug found in the program can be of any category with equal probability. Similarly, the bug can be found in any given subsystem with equal probability. Any particular bug cannot belong to two different categories or happen simultaneously in two different subsystems. The number of bugs in the program is almost infinite, so the probability of finding a new bug of some category in some subsystem does not reduce after finding any number of bugs of that category in that subsystem.
Find an average time (in days of Ivan’s work) required to name the program disgusting.
Input
Input file contains two integer numbers, n and s (0 < n, s <= 1 000).
Output
Output the expectation of the Ivan’s working days needed to call the program disgusting, accurate to 4 digits after the decimal point.
Sample Input
1 2
Sample Output
3.0000
Source
Northeastern Europe 2004, Northern Subregion
dp[i][j]表示 i种bug 属于j个系统情况下分别到n,m的情况下 的期望是多少
边栏推荐
- [C language] Detailed explanation of custom types: structure, enumeration, union
- 6.【opencv鼠标回调事件】
- sample函数—R语言
- 服务器配置——Linux系统安装Redis
- 张一鸣挺进生育大业
- 【黑马早报】巴菲特罕见巨亏近3000亿;周鸿祎回应360不能卸载;三亚倡议酒店不变相提高房价;首个国产抗新冠口服药定价不超300元...
- (7) FlinkSQL kafka data written to the mysql way 2
- serialize 序列化原生方法
- STM32 entry development to make infrared remote control (smart home-universal remote control)
- 牛 plus,多层嵌套动态 JSON 该如何解析总结
猜你喜欢
复盘:什么是秋招提前批?什么是普通秋招?都是招聘,为啥要设置这两个招聘时间段
Thesis understanding: "Self-adaptive loss balanced Physics-informed neural networks"
qsort 函数的使用及其模拟实现
连锁小酒馆第一股,海伦司能否梦圆大排档?
如果Controller里有私有的方法,能成功访问吗?
[8月4日]剑指 Offer 52. 两个链表的第一个公共节点
Implement a customized pin code input control
【Redis】redis安装与客户端redis-cli的使用(批量操作)
PE文件-手工修改重定位表-WinHex-CFF Explorer
华谊“在劫难逃”,4年亏掉64亿
随机推荐
【Personal Summary】2022.8.7 Week End
Pretraining Weekly Issue 56: Long Text Understanding, Instant Question Answering, Mask Self-Supervision
Program Environment and Preprocessing
删库不易,跑路更难
基于FPGA的FIR滤波器的实现(1)—采用fir1函数设计
2022-08-05
Qt的简易日志库实现及封装
STM32 entry development to make infrared remote control (smart home-universal remote control)
萤石、小米对垒智能摄像头
SQL INSERT INTO and INSERT INTO the SELECT statement
[C language] Detailed explanation of custom types: structure, enumeration, union
Qt 在循环中超时跳出
AfterEffect插件-图层排序-js脚本开发-AE插件
MapStruct入门使用
TS+Hooks二次封装antd Modal,实现可拖拽
连锁小酒馆第一股,海伦司能否梦圆大排档?
【JS高级】ES5标准规范之严格模式下的保护对象_09
清华|GLM-130B:一个开放的双语预训练模型
Three classic topics in C language: three-step flip method, Young's matrix, and tossing and dividing method
(8)FlinkSQL自定义UDF