Collecting Bugs(POJ 2096)】的更多相关文章

Collecting Bugs Time Limit: 10000MS   Memory Limit: 64000K Total Submissions: 3064   Accepted: 1505 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…
题目 传送门:QWQ 分析 数学期望 用$ dp[i][j] $表示发现了在$ j $个子系统里面发现了$ i $个bug到$ s $个子系统里面发现了$ n $个bug需要的期望天数. $ dp[0][0] $就是答案. 然后分类一下,可以转移到$ dp[i][j] $无非就是$ dp[i+1][j+1] $ $ dp[i][j+1] $ $ dp[i+1][j] $ $ dp[i][j] $ 各自分别算一下概率,比如从$ dp[i][j] $转移过来的话概率是$ \frac{i}{n} \t…
https://vjudge.net/problem/POJ-2096 题意 一个软件有s个子系统,会产生n种bug.某人一天发现一个bug,这个bug属于某种bug,发生在某个子系统中.求找到所有的n种bug,且每个子系统都找到bug,这样所要的天数的期望.需要注意的是:bug的数量是无穷大的,所以发现一个bug,出现在某个子系统的概率是1/s,属于某种类型的概率是1/n. 分析 dp[i][j]表示已经找到i种bug,并存在于j个子系统中,要达到目标状态的天数的期望.显然,dp[n][s]=…
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…
Collecting Bugs Time Limit: 10000MS   Memory Limit: 64000K Total Submissions: 6237   Accepted: 3065 Case Time Limit: 2000MS   Special Judge Description Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material s…
Charm Bracelet    POJ 3624 就是一道典型的01背包问题: #include<iostream> #include<stdio.h> #include<algorithm> #include<string.h> using namespace std; ],b[]; ]; int main() { int n,m,i,j; while(scanf("%d%d",&n,&m)!=EOF) { ;i&l…
Scout YYF I Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5565   Accepted: 1553 Description YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate into the enemy's base. After overcoming a series difficulties,…
题目链接:http://vjudge.net/contest/view.action?cid=51369#problem/A   (A - Children of the Candy Corn) http://poj.org/problem?id=2488   (A Knight's Journey) (不知道为什么,名字竟然不同哇~~~~还是poj 改名改得好) 题目意思:给出一个p * q 的棋盘,行用阿拉伯数字1,2,...,p-1, p 来表示,列从大写字母'A'开始表示.我这里为了简化…
取石子游戏 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 37662   Accepted: 12594 Description 有两堆石子,数量任意,可以不同.游戏开始由两个人轮流取石子.游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子:二是可以在两堆中同时取走相同数量的石子.最后把石子全部取完者为胜者.现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者…