摘要:
和poj 3352 一样, 相同的代码都能过。#include <stdio.h>#include <string.h>#include <iostream>using namespace std;#define N 5050#define M 10010#define INF 0x3fffffffstruct node{ int from,to,next;}edge[2*M];int n,m;int cnt,pre[N];bool mark[2*M];bool save[2*M];int low[N];int link[N];int d[N];void a 阅读全文
摘要:
先求出桥,然后去除桥后得到边双联通分量, 将边联通分量缩成一个点, 然后就出所有度为1的点(叶子节点)个数n,答案就是n/2+n%2.#include <stdio.h>#include <string.h>#include <iostream>using namespace std;#define N 5050#define M 10010#define INF 0x3fffffffstruct node{ int from,to,next;}edge[2*M];int n,m;int cnt,pre[N];bool mark[2*M];bool save 阅读全文