Gym 100512B Betting Fast (题意+概率)】的更多相关文章

题意:你开始有 s 元钱,然后你要在 t 场内赚到 n 元,每次赢的概率是 p,并且要越快越好. 析:当时没注意这个条件,要越快越好,然后写概率dp,怎么看也不像是对.其实是每次赌 min(s, n-s),尽快结束,就两种决策,要么赢,要么输, 就简单了. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #inclu…
https://codeforces.com/gym/100608 题意: 两个人玩游戏,每个人有一个长为d的b进制数字,两个人轮流摇一个$[0,b-1]$的骰子,并将选出的数字填入自己的d个空位之中 最后数字大的人赢 有两种玩法,第一个是轮流玩,一个是第一个人玩d次之后,第二个人玩 两个人都非常聪明,求第一个人的最大胜率 $d,b<=10,(b+1)^d<=3000$ 题解: 很有意思的是,他保证了$(b+1)^d<=3000$,也就是b+1进制数字不会超过3000的大小 我们考虑暴搜…
You're trying to set the record on your favorite video game. The game consists of N levels, which must be completed sequentially in order to beat the game. You usually complete each level as fast as possible, but sometimes finish a level slower. Spec…
参考博客:http://www.cnblogs.com/kang000/p/8571071.html  (这篇博客写的真的走心,ORZ) 题意有n个硬币排成一排,开始的时候所有的硬币都是正面朝下,你必须要扔K次硬币,每次选择一个硬币,如果你采取最优策略,K次以后朝上的硬币数的最大期望是多少? 分析 一脸懵逼两脸懵逼三脸懵逼··· -------------------------------------------------------------------------- 随机变量X是指朝上…
题意:n个球,两个人每人选C个球作为目标,然后放回.每回合有放回的拿出D个球,如果有目标球,就实现了这个目标,直到至少一个人实现了所有目标游戏结束.问结束回合的期望.误差1e-3以内. 思路:概率DP,因为终止条件是目标数,那么A的目标数B的目标数是一定要有的,但是AB之间可能有交集,那么我就把他单独列出来,我们设dp[t][i][j][k]表示第t回合a有i个独有的没涂b有j个独有的没涂有k个共有的没涂.那么我们可以得到状态转移方程: $\LARGE{dp[t][ii][jj][kk] = d…
B. New Job time limit per test:1 second memory limit per test:64 megabytes input:standard input output:standard output This is the first day for you at your new job and your boss asks you to copy some files from one computer to other computers in an…
[CF865C]Gotta Go Fast 题意:有n个关卡需要依次通过,第i关有pi的概率要花ai时间通过,有1-pi的概率要花bi时间通过,你的目标是花费不超过m的时间通关,每一关开始时你都可以选择进行这个关卡或是重新开始.问你达成目标的最短期望总时间(假设你是绝顶聪明的). n<=50,m<=5000. 题解:设f[i][j]表示已经完成了前i关,用了j的时间,期望的通关最小总时间.那么每一关开始时你都可以选择打或不打,所以得到DP方程: f[i-1][j]=min(f[0][0],(f…
A - Coins Time Limit:3000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Description standard input/output Hasan and Bahosain want to buy a new video game, they want to share the expenses. Hasan has a set of N coins and Bahosain has a…
J. Polygons Intersection time limit per test:2 seconds memory limit per test:64 megabytes input:standard input output:standard output We will not waste your time, it is a straightforward problem. Given multiple polygons, calculate the area of their i…
H. Special Palindrome time limit per test:1 second memory limit per test:64 megabytes input:standard input output:standard output A sequence of positive and non-zero integers called palindromic if it can be read the same forward and backward, for exa…