hdu4405 Aeroplane chess 期望
来源:互联网 发布:java httpclient 异步 编辑:程序博客网 时间:2024/05/16 00:55
大牛说的很清楚。。点击打开链接
#include<iostream>#include<stdio.h>#include<string.h>using namespace std;double dp[100010];int flag[100010];int x,y;int main(){ int n,m; while(scanf("%d%d",&n,&m)&&n!=0) { for(int i=0;i<=n;i++) dp[i]=0; memset(flag,0,sizeof(flag)); while(m--) { scanf("%d%d",&x,&y); flag[x]=y; } for(int i=n-1;i>=0;i--) { if(flag[i]) dp[i]=dp[flag[i]]; else { for(int j=1;j<=6;j++) { if(i+j<=n) dp[i]+=(1.0/6)*dp[i+j]; else break; } dp[i]+=1.0; } } printf("%.4lf\n",dp[0]); }}
- hdu4405 Aeroplane chess 期望
- hdu4405 Aeroplane chess 【期望dp】
- 【期望DP】HDU4405 Aeroplane chess
- hdu4405 Aeroplane chess---金华网络赛 期望
- hdu4405--Aeroplane chess+概率期望dp
- hdu4405 Aeroplane chess(期望dp)
- HDU4405 Aeroplane chess (概率DP求期望)
- hdu4405 Aeroplane chess【概率DP+期望问题】
- HDU4405:Aeroplane chess(概率dp & 期望)
- LightOJ 1030 Discovering Gold + Hdu4405 Aeroplane chess (期望)
- HDU4405-Aeroplane chess(概率DP求期望)
- hdu4405[Aeroplane chess] 有点懂了期望概率DP
- HDU4405 Aeroplane chess
- hdu4405 Aeroplane chess
- HDU4405 Aeroplane chess
- HDU4405-Aeroplane chess
- Hdu4405 Aeroplane chess 数论
- 【HDU4405】Aeroplane chess
- Centos下安装设置PPTP
- HDU 1032 The 3n + 1 problem
- Android中Toast的用法简介(转)
- for循环下的scanf("%s%c")问题
- QQ视频聊天时可以给对方加特效恶搞对方的软件--- 变色鸟摄像头视频特效
- hdu4405 Aeroplane chess 期望
- 如何在ecshop中实现后台商品列表显示会员等级价格的解决办法
- Java IO(文件操作工具类)
- linux下补丁的创建及使用原理
- 破解学习笔记-----获取按钮事件地址---追出注册吗----编写内存注册机
- 持久层理解 hibernate
- MFC如何自定义消息
- Java反射机制-调用setter及getter方法
- 最长单调子序列