摘要:
const int N=100010; int n, a, b; vector<int> e[N];//用vector作邻接表 int siz[N], pos, ans=1e9; void dfs(int x, int fa){ siz[x]=1; int mx=0; for(auto y : e[ 阅读全文
摘要:
https://www.luogu.com.cn/problem/P4316 本题暂时只写了用期望dp经典套路,套上期望DP的基本套路,设dp(u)为到达u点的期望长度。 期望dp,也叫概率dp 一般来说,期望dp找到正确的状态后,转移是比较容易想到的。 但一般情况下,状态一定是“可数”的 事实上, 阅读全文