
概率&&期望DP
算概率和期望的动态规划
为什么他们cf写的这么快
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ - 3071 Football(概率DP)
题目链接Consider a single-elimination football tournament involving 2n teams, denoted 1, 2, …, 2n. In each round of the tournament, all teams still in the tournament are placed in a list in order of increasing index. Then, the first team in the list plays the原创 2020-05-22 22:25:53 · 158 阅读 · 0 评论 -
POJ - 2096 Collecting Bugs(期望DP)
题目链接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 i原创 2020-05-20 21:31:00 · 143 阅读 · 0 评论 -
Codeforces Beta Round #30 (Codeforces format) C. Shooting Gallery(简单概率DP)
题目链接题意:在一个垂直的二维平板给出n个目标的坐标,每次瞄完一个目标后实现在平板上移动的速度为1,瞄准第ii个目标后射中的概率为pi,且第i个目标只在第ti秒出现,也就是说只能在第ti秒瞄准该目标并射击,问射中目标数的期望值最大为多少?思路:当点与点之间的距离小于他们的时刻时,概率就可以相加。#include<bits/stdc++.h>using namespace st...原创 2020-03-12 21:04:31 · 152 阅读 · 0 评论 -
Codeforces Beta Round #50 C. First Digit Law(概率DP+数位DP)
题目链接思路:其实也不着数位DP啦,因为它说只要开头1的可以很快算出来,我们先求出每个区间随机取一个数是开头为1的概率p【i】,然后dp【i】【j】表示前i个选了j个开头为1的概率。状态只有2个,一个是取就是p【i】,不取就是1-p【i】。这个题精度卡了我半天。。。#include<bits/stdc++.h>using namespace std;typedef long...原创 2020-03-12 20:49:55 · 345 阅读 · 0 评论 -
Codeforces Round #114 (Div. 1) B. Wizards and Huge Prize(概率DP)
题目链接思路:dp【i】【j】【k】表示i场比赛赢了j场背包容量为k时的概率,转移状态也只有两个一个取一个不取。#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=201;double ans=0,a[maxn],dp[maxn][maxn][maxn<<...原创 2020-03-12 20:42:53 · 135 阅读 · 0 评论 -
Codeforces Round #146 (Div. 1) B. Let's Play Osu!(期望DP)
题目链接#include<bits/stdc++.h>#define N 100005using namespace std;int n;double a, f1, f2;int main () { scanf ("%d", &n); for (int i = 1; i <= n; ++i) { scanf ("%lf", ...原创 2020-03-12 20:39:37 · 210 阅读 · 0 评论 -
Codeforces Round #604 (Div. 2) E - Beautiful Mirrors(概率DP)
题意:有n面镜子,作者每天都会来问魔镜,魔镜有pi/100得概率会告诉作者她很美丽,如果魔镜说美丽,那么作者会很开心,否则作者会从第一面镜子重新开始问,问最后到第n面镜子是作者是开心得期望天数。思路:设dp[i]为第i面镜子作者开心的期望天数,则dp[i]=(dp[i-1]+1)(pi/100))【开心】+(dp[i]+dp[i-1]+1)(1-pi/100)【沮丧】,移项就得dp[i]=(d...原创 2020-01-28 21:54:38 · 206 阅读 · 0 评论