![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
概率dp
coder_coder_coder
默默的程序猿
展开
-
UVA11762 Race to 1
#include #include #include using namespace std; const int N=1000005; int p[N],tmp[N],maxn; double dp[N]; void prime(){ for(int i=2;i<N;i++) for(int j=i+i;j<N;j+=i) p[j]=1;原创 2014-08-16 23:05:07 · 381 阅读 · 0 评论 -
hdu3853LOOPS概率dp
#include #include #include #include #include using namespace std; const int N=1005; const double eps=1e-9; int r,c; double p1[N][N],p2[N][N],p3[N][N],dp[N][N]; int main() { while(scanf("%d%d"原创 2014-08-16 22:57:48 · 356 阅读 · 0 评论 -
hdu4336Card Collector_概率dp
//hdu4336 #include #include #include using namespace std; const int N=25; double dp[1<<20],p[N]; //dp[s] = (1 - ∑( p[i] ))*dp[s]+ ∑( p[i]*dp[ s ^ (1<<i) ] ) +1; //dp[s]=(∑( p[i]*dp[ s ^ (1<<i) ]原创 2014-08-16 22:59:02 · 276 阅读 · 0 评论 -
UVA11722Joining with Friend概率dp
#include #include #include using namespace std; double t1,t2,s1,s2,w; //取t为x轴,s为y轴 double geta(int b){//y=x+b,-90<=b<=90,取与四线的交点进行比较 int y1=t1+b,y2=t2+b; if(y2<s1) return 0; if(y1<s1){原创 2014-08-16 23:02:51 · 587 阅读 · 0 评论