【BZOJ1419】Red is good 期望DP
来源:互联网 发布:ubuntu 安装iso文件 编辑:程序博客网 时间:2024/05/21 09:58
题目大意
桌面上有
题解
设
最后答案是
辣鸡出题人卡空间要用滚动数组才能过
时间复杂度:
代码
#include<cstdio>#include<cstring>#include<algorithm>#include<cstdlib>#include<ctime>#include<utility>using namespace std;typedef long long ll;typedef pair<int,int> pii;double f[2][5010];int main(){// freopen("bzoj1419.in","r",stdin); int n,m; scanf("%d%d",&n,&m); int i,j; int t=0; for(i=0;i<=n;i++) { t^=1; f[t][0]=i; for(j=1;j<=m;j++) f[t][j]=max(0.,(f[t^1][j]+1)*double(i)/(i+j)+(f[t][j-1]-1)*double(j)/(i+j)); } ll s=f[t][m]*1000000; printf("%lld.%.6lld\n",s/1000000,s%1000000); return 0;}
阅读全文
0 0
- 【bzoj1419】Red is good 期望dp
- [bzoj1419]Red is good 期望DP
- 【BZOJ1419】Red is good 期望DP
- BZOJ1419:Red is good(期望DP)
- 【BZOJ1419】【期望DP】Red is good 题解
- 【期望DP】BZOJ1419[Red is good]题解
- [BZOJ1419]Red is good(概率期望dp)
- bzoj1419: Red is good
- Bzoj1419 Red is good
- [BZOJ1419]Red is good 数学期望动态规划
- BZOJ 1419 Red is good 期望DP
- BZOJ 1419: Red is good|期望Dp
- bzoj 1419: Red is good 期望dp
- 【BZOJ 1419】Red is good 期望dp
- BZOJ 1419: Red is good 期望DP
- BZOJ 1419: Red is good 期望DP
- bzoj 1419 Red is good 【期望dp】
- 1419: Red is good 概率与期望 DP
- 了解百度云
- 配置和烧录LED闪烁例程
- 滴滴笔试编程题第一题
- JavaScript高级程序设计----读书笔记,第一、二章
- 还在疑惑并发和并行?
- 【BZOJ1419】Red is good 期望DP
- 机器人打高尔夫球
- Java的简单应用之插入排序和shell排序
- VirtualBox虚拟机中安装CentOS 7(七)安装mariadb
- [偏难] UVa OJ 1625 Color Length 动态规划
- BZOJ 2140 稳定婚姻
- c++11 chrono全面解析(最高可达纳秒级别的精度)
- niginx.conf文件的结构说明
- 9月份学习目标