【期望DP】HDU4405 Aeroplane chess
来源:互联网 发布:提升关键词排名软件 编辑:程序博客网 时间:2024/05/24 04:23
题面在这里
还是期望DP的老套路……
从后往前DP,
还有题意貌似是能飞就必须飞?没讲清楚啊
示例程序:
#include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int maxn=100010;int n,m,to[maxn];double f[maxn];int main(){ scanf("%d%d",&n,&m); while (n){ for (int i=0;i<=n;i++) to[i]=i; for (int i=1,x,y;i<=m;i++) scanf("%d%d",&x,&y),to[x]=y; memset(f,0,sizeof(f)); for (int i=n-1;i>=0;i--){ if (to[i]>i) {f[i]=f[to[i]];continue;} f[i]=1; for (int j=1;j<=6;j++) f[i]+=f[i+j]/6; } printf("%.4lf\n",f[0]); scanf("%d%d",&n,&m); } return 0;}
阅读全文
0 0
- hdu4405 Aeroplane chess 【期望dp】
- 【期望DP】HDU4405 Aeroplane chess
- hdu4405--Aeroplane chess+概率期望dp
- hdu4405 Aeroplane chess(期望dp)
- HDU4405 Aeroplane chess (概率DP求期望)
- hdu4405 Aeroplane chess【概率DP+期望问题】
- HDU4405:Aeroplane chess(概率dp & 期望)
- hdu4405 Aeroplane chess 期望
- HDU4405-Aeroplane chess(概率DP求期望)
- hdu4405[Aeroplane chess] 有点懂了期望概率DP
- hdu4405 Aeroplane chess (概率dp)
- HDU4405--Aeroplane chess--概率DP
- 【HDU4405】【Aeroplane chess】【概率dp】
- hdu4405 Aeroplane chess---金华网络赛 期望
- LightOJ 1030 Discovering Gold + Hdu4405 Aeroplane chess (期望)
- HDU4405 Aeroplane chess
- hdu4405 Aeroplane chess
- HDU4405 Aeroplane chess
- 记录使用svn的过程
- 死锁
- 海量数据面试题整理
- [jzoj5462]【NOIP2017提高A组冲刺11.8】好文章
- 软件工程(C编码实践篇)学习总结
- 【期望DP】HDU4405 Aeroplane chess
- Word2vec参数
- https数据传输协议(安全套接字层超文本传输协议)
- SD 卡
- 最近文化课和训练的总结 && NOIP2017赛前检查
- typedef int (*funcptr)() 用法
- Imageloader 的图片适配
- linux防火墙限制IP远程登录服务器?
- hdu1279 验证角谷猜想