POJ 2096 Collecting Bugs:期望dp】的更多相关文章

题目链接: http://poj.org/problem?id=2096 Collecting Bugs Time Limit: 10000MSMemory Limit: 64000K 问题描述 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…
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…
C - Collecting Bugs Time Limit:10000MS     Memory Limit:64000KB     64bit IO Format:%I64d & %I64u Submit Status Description Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software b…
Collecting Bugs Time Limit: 10000MS   Memory Limit: 64000K Total Submissions: 2745   Accepted: 1345 Case Time Limit: 2000MS   Special Judge Description Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material s…
题目链接 题意: 一个人受雇于某公司要找出某个软件的bugs和subcomponents,这个软件一共有n个bugs和s个subcomponents,每次他都能同时随机发现1个bug和1个subcomponent,问他找到所有的bugs和subcomponents的期望次数. 一个软件有s个子系统,会产生n种bug 某人一天发现一个bug,这个bug属于一个子系统,属于一个分类 每个bug属于某个子系统的概率是1/s,属于某种分类的概率是1/n 问发现n种bug,每个子系统都发现bug的天数的期…
题意:给定 n 类bug,和 s 个子系统,每天可以找出一个bug,求找出 n 类型的bug,并且 s 个都至少有一个的期望是多少. 析:应该是一个很简单的概率DP,dp[i][j] 表示已经从 j 个子系统中,找出 i 种类型的bug,达到目标所需要天数的期望, 很明显dp[n][s] = 0.0,而dp[0][0] 就是答案,剩下的就比较简单了, dp[i][j] = (dp[i+1][j]*(n-i)*j + dp[i][j+1]*i*(s-j) + dp[i+1][j+1]*(n-i)*…
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 exac…
poj 2096 题目:http://poj.org/problem?id=2096 f[ i ][ j ] 表示收集了 i 个 n 的那个. j 个 s 的那个的期望步数. #include<cstdio> #include<cstring> #include<algorithm> #define db double using namespace std; ; db n,s,f[N][N]; int main() { scanf("%lf%lf"…
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…
题目链接:http://poj.org/problem?id=2096 题意: 有一个程序猿,他每天都会发现一个bug. bug共有n个种类.属于某一个种类的概率为1/n. 有s个子系统,每个bug属于一个系统.属于某一个系统的概率为1/s. 问你发现的bug能够覆盖到n个种类和s个系统的期望天数. 题解: 期望dp转移的套路: 倒着推. 利用性质:期望 = ∑ (P(子期望)*φ(子期望)) 状态表示: dp[i][j] = expectation i:覆盖到i个种类 j:覆盖到j个系统 dp…