概率DP

  kuangbin总结中的第8题

  一开始题目看错导致想转移方程想错了……想成f[i][j]表示前 i 个队伍中最多的做出来 j 道题的概率……sigh

  看了下题解……其实是对于每个队伍 i 单独考虑做出来 j 道题的概率!!最后再根据情况将t个队伍合并起来……

WA:又忘了POJ上double输出应该用%f了……so sad

aaarticlea/gif;base64,R0lGODlhQgBCAOYAAP////f///f3//f39+/39+b39+/v7+/v5ubv797v797v99bv7+bm5t7m5t7m79bm79bm5s7m7+be3t7e3r3m5s7e5sXe3r3e5t7W1tbW3tbW1rXe5sXW1tbOzrXW1s7Ozs7OxaXW3pzW3r3Ozq3Ozs7FxcXFxZTO1sW9vaXFzr29vZzFxb29tYzF1oTFzr21tbW1tYy9xaW1tbWtra2trXO1va2lpYyttaWlnO+MhGutvaWcnJycnFqttb2MjIScnJyUlJSUlEKlre9zc5SMjIyMjIyMhFqUnIyEhISEhHuEjO9jY85rY4R7e3t7e7Vra5Rzc3N7e+ZaY2t7e5xra3tzc3Nzc+ZSWoRra3tra2tra5xaWmNjY95CSrVKSlpaWs4xQs4hQkJCQikZGf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgBkACwDAAgAPwAyAAAH/4BkgoOEhWQSBoaKi4yNjoYAJkhalFpAGAAAAxicnRKZmY+iowNEWk02HyY7VlpErZWxrjOfAKO3igOTNqCZAzM7LJi9ABIfNpNOJgO2xLa4jAA2WioTztfXBjZWVibYz9CFBpYTtd/nmjNWSBgfM++0oOGDACxaGhPW6Oj5k7Kn3sBBA8AKQbl96AxO2PEBlAETTbTsEIgLABEiDMwRC6LPF4tvDCYwc7ZDIsVRFpEY+DZGQy8ELbEZyIit5Id5AJAg+ZbkizMuX1xmY7DS2YB189RpBGWCS5CRvQYEGaMlm4EJDIgZ0KZlALRxHxGKzbQ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0BiLSlFyELBVdACOu5EAMASHixaBhXEPIEEQZkwMMPP9zQgiCyhiTmV7M0gxBcmfTzASa/BjusFsbOmSwhTDiRRIBN+KjFDy3IasBRBthAxCwAMJZXJkioFC57/JGbaCRDPKEFESZc8hh2UeiwAgNHDeAEarwslcz/rmSwYN8A/1JrwYrGnjtIDlAggQFacX0VRQ2G3XLeUrCw+/I4DDGQALCxegByF0v07LMPTQxAU175vnsUAzbY5xgruCDS44swAQAEszevV4PO5Prscw5ZoDABAkQ/ZoUT9JKFLwC37FCTphRG3dE=" alt="" />

 //POJ 2151
#include<cmath>
#include<vector>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define rep(i,n) for(int i=0;i<n;++i)
#define F(i,j,n) for(int i=j;i<=n;++i)
#define D(i,j,n) for(int i=j;i>=n;--i)
#define pb push_back
using namespace std;
int getint(){
int v=,sign=; char ch=getchar();
while(!isdigit(ch)) {if(ch=='-') sign=-; ch=getchar();}
while(isdigit(ch)) {v=v*+ch-''; ch=getchar();}
return v*sign;
}
const int N=,INF=~0u>>;
/*******************template********************/
double p[N][],f[N][][],s[N][];
int main(){
int n,m,t;
while(scanf("%d%d%d",&m,&t,&n)!=EOF && m){
F(i,,t) F(j,,m) scanf("%lf",&p[i][j]); F(i,,t){
f[i][][]=1.0;
F(j,,m)
f[i][j][]=f[i][j-][]*(-p[i][j]);
F(j,,m) F(k,,j)
f[i][j][k]=f[i][j-][k-]*p[i][j]+f[i][j-][k]*(-p[i][j]);
s[i][]=f[i][m][];
F(k,,m) s[i][k]=s[i][k-]+f[i][m][k];
}
double p1=,p2=;
F(i,,t){
p1*=(-s[i][]);
p2*=(s[i][n-]-s[i][]);
}
printf("%.3f\n",p1-p2);
}
return ;
}

【POJ】【2151】Check the difficulty of problems的更多相关文章

  1. 【POJ】2151:Check the difficulty of problems【概率DP】

    Check the difficulty of problems Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 8903   ...

  2. POJ 2151 Check the difficulty of problems 概率dp+01背包

    题目链接: http://poj.org/problem?id=2151 Check the difficulty of problems Time Limit: 2000MSMemory Limit ...

  3. POJ 2151 Check the difficulty of problems

    以前做过的题目了....补集+DP        Check the difficulty of problems Time Limit: 2000MS   Memory Limit: 65536K ...

  4. Check the difficulty of problems(POJ 2151)

    Check the difficulty of problems Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5457   ...

  5. POJ 2151 Check the difficulty of problems (动态规划-可能DP)

    Check the difficulty of problems Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 4522   ...

  6. [ACM] POJ 2151 Check the difficulty of problems (概率+DP)

    Check the difficulty of problems Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 4748   ...

  7. Check the difficulty of problems

    Check the difficulty of problems Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 5830 Acc ...

  8. POJ 2151 Check the difficulty of problems:概率dp【至少】

    题目链接:http://poj.org/problem?id=2151 题意: 一次ACM比赛,有t支队伍,比赛共m道题. 第i支队伍做出第j道题的概率为p[i][j]. 问你所有队伍都至少做出一道, ...

  9. 【POJ】2151 Check the difficulty of problems

    http://poj.org/problem?id=2151 题意:T个队伍M条题目,给出每个队伍i的每题能ac的概率p[i][j],求所有队伍至少A掉1题且冠军至少A掉N题的概率(T<=100 ...

随机推荐

  1. 如何用ASP.NET实现bosh模拟http双向长连接请求

    在做研究之前先简单说一下之前公司的通讯模块.最早的时候公司开发的web管理系统是需要配合c++桌面客户端进行一些系统底层操作,并非普通的b/s架构,或者c/s架构,因为需求是可以通过web管理系统向客 ...

  2. 网站seo新手快速提升自己的技巧

    第一.找自身的问题 大多数从业者都有下面两个严重的问题: 1.过于放大SEO的重要性每个人,都有自大的习惯,地位越NB往往越把自己认知的一切当做真理,其实有可能那只是井口那巴掌大的一片天.在网络营销中 ...

  3. Js中把JSON字符串转换为JSON对象(eval()、new Function())

    在JS中将JSON的字符串解析成JSON数据格式,一般有两种方式: 1.一种为使用eval()函数. 2. 使用Function对象来进行返回解析. 第一种解析方式:使用eval函数来解析,并且使用j ...

  4. C# 获取文件名及扩展名

    C# 获取文件名及扩展名 string aFirstName = aFile.Substring(aFile.LastIndexOf("\\") + 1, (aFile.LastI ...

  5. [老老实实学WCF] 第二篇 配置WCF

    老老实实学WCF 第二篇 配置WCF 在上一篇中,我们在一个控制台应用程序中编写了一个简单的WCF服务并承载了它.先回顾一下服务端的代码: using System; using System.Col ...

  6. JavaScript语言基础-环境搭建

    我们要想编写和运行JavaScript脚本,则需要:JavaScript编辑工具和JavaScript运行测试环境.下面我们分别介绍一下.JavaScript编辑工具JavaScript编辑工具最简单 ...

  7. 《iOS开发指南》要改iOS8版本了,听听您的意见?

    <iOS开发指南>要改iOS8版本了,听听您的意见?参加问卷同学均可获得智捷课堂50元代金卡一张,同时抽取一名同学赠送即将出版的基于iOS8的<iOS开发指南>一本,欢迎大家填 ...

  8. Objective-C 【protocol-协议 的了解使用】

    ------------------------------------------- protocol(协议) (1)引文:OC中的protocol和Java中的接口(interface)比较类似, ...

  9. 【Unity3D实战】方块跑酷初级开发实战(一)

    [Unity3D实战]方块跑酷初级开发实战(一) 欢迎大家来到LDS的博客,今天开始我们讲解一下跑酷类游戏的基本操作,本文为原创,视频请观看[ http://www.mkcode.net/html/u ...

  10. [转]解决win8.1右键菜单出现在左边

    1.在控制面板中找到“Tablet PC 设置”窗口,选择“其他”选项卡. 2.在“左右手使用习惯”下,点选“惯用左手”,确定. •如果win8.1的控制面板里找不到Tablet PC 设置 •可以在 ...