摘要: tarjan求割点,每个点双如果不连割点,内部应建两个,连着一个割点,应建一个,连着多个,不用建#include#include#include#include#include#define N 1500using namespace std;int n,m,cnt,... 阅读全文
posted @ 2017-08-10 21:48 Ren_Ivan 阅读(116) 评论(0) 推荐(0) 编辑
摘要: k#include#include#include#include#include#define N 500500using namespace std;int n,m,k,S,T;struct point{ int st,dis; bool operat... 阅读全文
posted @ 2017-08-10 20:14 Ren_Ivan 阅读(93) 评论(0) 推荐(0) 编辑
摘要: f[x][0]表示与其父边相连的连通块内没有黑苹果的方案数,f[x][1]则表示有黑苹果,如果父边被切断,相当于没有黑苹果初始化时,假设切掉父边,f[x][0]=1,f[x][1]=0;递归回时转移,每递归回一个子树,f[x][1]=f[x][1]*f[v][0]+f... 阅读全文
posted @ 2017-08-10 15:54 Ren_Ivan 阅读(111) 评论(0) 推荐(0) 编辑