摘要:
#include #include #include using namespace std;const int maxn = 2100;struct node{ int v,next;}edge[maxn*maxn];int head[maxn],res[1005*1005][2],low[maxn],dfn[maxn],stack[maxn],in[maxn];int n,m,id,clock,top;void add_edge(int u,int v){ edge[id].v = v;edge[id].next = head[u];head[u] = id++;}void i... 阅读全文
摘要:
状态转移方程:dp[u][0] = max(dp[v][0],dp[v][1]);dp[u][1] += dp[v][0];#include #include #include #include #include using namespace std;const int maxn = 6010;vectortree[maxn];int rat[maxn],deg[maxn],dp[maxn][2];int max(int x,int y){ return x > y ? x : y;}void dfs(int u){ if(0 == tree[u].size()) { ... 阅读全文