摘要: dp求期望的题。 设 E[i]表示在结点i处,要走出迷宫所要走的边数的期望。E[1]即为所求。 叶子结点: E[i] = ki*E[1] + ei*0 + (1-ki-ei)*(E[father[i]] + 1); = ki*E[1] + (1-ki-ei)*E[... 阅读全文
posted @ 2014-11-20 16:58 chenjunjie1994 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 概率DP期望,逆推即可。使用状态压缩。注意,要全部输出。。。看DIS才发现题目输出是个坑。。#include #include #include #include using namespace std;double state[(1=0;i--){ if(i==al){ state[i]... 阅读全文
posted @ 2014-11-20 15:09 chenjunjie1994 阅读(190) 评论(0) 推荐(0) 编辑