hdu4576 Robot 滚动数组
来源:互联网 发布:node调用webservice 编辑:程序博客网 时间:2024/05/22 12:32
直接暴力
#include <stdio.h>#include <string.h>#include <algorithm>#include <cstring>double dp[205][2];int main(){ int n,m,l,r; while(scanf("%d%d%d%d",&n,&m,&l,&r)!=EOF) { if(n+m+l+r==0)break; memset(dp,0,sizeof(dp)); dp[0][0]=1; int temp=0; while(m--) { int w; scanf("%d",&w); w=w%n; temp^=1; for(int i=0;i<n;i++) { dp[i][temp]=0.5*dp[(i+w+n)%n][temp^1]+0.5*dp[(i-w+n)%n][temp^1]; } } double ans=0; for(int i=l-1;i<=r-1;i++) { ans+=dp[i][temp]; } printf("%.4lf\n",ans); }; return 0;}
0 0
- hdu4576 Robot 滚动数组
- hdu4576 Robot
- HDU4576 Robot
- HDU4576 Robot
- 【HDU4576】Robot
- HDU4576 Robot 概率DP
- 【hdu4576】【期望Dp】Robot
- hdu4576 Robot (概率DP)
- hdu 4576 Robot(dp+滚动数组)
- hdu 4576 D - Robot dp+滚动数组
- hdu4576 Robot 2013 ACM-ICPC杭州赛区全国邀请赛 1
- [ACM] HDU 4576 Robot (概率DP,滚动数组)
- Robot Framework自动化测试-滚动页面
- 滚动数组
- 滚动数组
- 滚动数组
- 滚动数组
- 滚动数组
- Structured vs. Unstructured Data: The Rise of Data Anarchy
- Apache Pig的一些基础概念及用法总结(1)
- UVA 11387 The 3-Regular Graph
- linux脚本编程---linux的变量
- Jquery基础概括
- hdu4576 Robot 滚动数组
- 卷积计算
- 安卓中的事件监听器
- photoshop简单但却实用的小技巧
- PHP装饰模式
- 外观模式C++实现
- 习题1.11
- Length of Last Word
- uva 10881 Piotr's Ants