【poj2096】Collecting Bugs】的更多相关文章

[POJ2096]Collecting Bugs 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. E…
题目描述 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…
题目描述 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…
http://poj.org/problem?id=2096 (题目链接) 题意 有一个程序,其中有s个子结构,每个子结构出bug的概率相等.bug总共分成n类,每种bug出现的概率相等.每天找出一个bug,求所有子结构都出现bug并且每种bug都出现过所需要的期望天数. Solution 终于领会了期望dp的一点点... 细节 %.4lf用G++交会Wa.. 代码 // poj2096 #include<algorithm> #include<iostream> #include…
概率DP/数学期望 kuangbin总结中的第二题 大概题意:有n个子系统,s种bug,每次找出一个bug,这个bug属于第 i 个子系统的概率为1/n,是第 j 种bug的概率是1/s,问在每个子系统中至少找出一个bug,且每种bug都找到过,总共需要找到bug的总数的期望值(我擦我这破烂语文水平……还不如不翻译) 题解:http://www.cnblogs.com/kuangbin/archive/2012/10/02/2710621.html 额之前理解的有些偏差……重新梳理一下: 现在已…
[题目链接] http://poj.org/problem?id=2096 [算法] 概率DP [代码] #include <algorithm> #include <bitset> #include <cctype> #include <cerrno> #include <clocale> #include <cmath> #include <complex> #include <cstdio> #inclu…
题意 有s个系统,n种bug,小明每天找出一个bug,可能是任意一个系统的,可能是任意一种bug,即是某一系统的bug概率是1/s,是某一种bug概率是1/n. 求他找到s个系统的bug,n种bug,需要的天数的期望. 分析 计算期望E=∑所有可能需要的天数*概率 找到s个系统n种bug,需要最少max(s,n)天,而可能的天数是无穷的,这样计算很复杂,复杂到算不了. 所以考虑dp,期望E=∑(昨天可以转移到现在状态的所有可能的情况的期望+1)*概率=∑(昨天可以转移到现在状态的所有可能的情况的…
http://overapi.com/   这个网站可以查询到所有与编程相关的各种技术,并给出详细的知识点(干货).…
Collecting Bugs Time Limit: 10000MS   Memory Limit: 64000K Total Submissions: 3523   Accepted: 1740 Case Time Limit: 2000MS   Special Judge Description Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material s…
Collecting Bugs Time Limit: 10000MS   Memory Limit: 64000K Total Submissions: 1792   Accepted: 832 Case Time Limit: 2000MS   Special Judge Description Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material st…