概率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. 对Json字符串进行格式化显示

    很多时候,我们拿Json字符串作为返回结果,但是当数据量多的时候,一堆的Json字符串看起来很不直观,这时候我们可以使用以下办法将Json字符串格式化一下再输出 var JsonUti = { //定 ...

  2. 集合类学习之ArrayList源码解析

    1.概述 ArrayList是List接口的可变数组的实现.实现了所有可选列表操作,并允许包括 null 在内的所有元素.除了实现 List 接口外,此类还提供一些方法来操作内部用来存储列表的数组的大 ...

  3. 【学习笔记】【C语言】逗号运算符

    逗号运算符主要用于连接表达式,例如: int a = 9; int b = 10; a = a+1 , b = 3*4; * 用逗号运算符连接起来的表达式称为逗号表达式,它的一般形式为: 表达式1, ...

  4. HashSet和LinkedHashSet特点.

    1)::HashSet-------(内部为HashCode表数据结构)---(保证数据唯一,但不保证数据有序) 不对数据进行排序,只是通过hashCode和equal对数据进行相同判定,如果相同就不 ...

  5. Cstring使用说明

    CString::Left(intnCount)const; //从左边1开始获取前 nCount个字符 CString::Mid(intnFirst)const; //从左边第 nCount+1个字 ...

  6. 济南学习 Day 5 T1 pm

    欧拉函数(phi)题目描述: 已知(N),求phi(N). 输入说明: 正整数N. 输出说明: 输出phi(N). 样例输入: 8 样例输出: 4 数据范围: 对于20%的数据,N<=10^5 ...

  7. poj 3268 Silver Cow Party

                                                                                                       S ...

  8. Linux C 程序 线程(18)

    线程控制 1.线程与进程的关系 线程:计算机中独立运行的最小单位. 在用户角度:多个线程是同时执行的. 操作系统角度:各个线程交替执行 以上只针对单核CPU的情况 在多核CPU主机上,多个线程可以同时 ...

  9. [DevExpress]ChartControl之时间轴示例

    关键代码: using System; using System.Data; using System.Windows.Forms; using DevExpress.XtraCharts; name ...

  10. CentOS安全设置

    删除多余的用户和用户组,修改口令文件属性,禁止[Ctrl+Alt+Delete]重启命令,防止别人ping的方法.整理自互联网. 1.删除多余的用户和用户组 //删除多余用户 # vi /etc/pa ...