ACM: 无向图的强连通分量 图论题 p…
来源:互联网 发布:淘宝网左轮吉他直播 编辑:程序博客网 时间:2024/05/22 02:27
Description
You will be given a list of streets (all two-way) of the city. Eachstreet connects two intersections, and does not go through anintersection. At most four streets meet at each intersection, andthere is at most one street connecting any pair of intersections.It is possible for an intersection to be the end point of only onestreet. You may assume that it is possible for a motorist to drivefrom each destination to any other destination when every street isa two-way street.
Input
Output
Note: There may be many possible direction assignments satisfyingthe requirements. Any such assignment is acceptable.
Sample Input
7 10
1 2
1 3
2 4
3 4
4 5
4 6
5 7
6 7
2 5
3 6
7 9
1 2
1 3
1 4
2 4
3 4
4 5
5 6
5 7
7 6
0 0
Sample Output
1
1 2
2 4
3 1
3 6
4 3
5 2
5 4
6 4
6 7
7 5
#
2
1 2
2 4
3 1
4 1
4 3
4 5
5 4
5 6
6 7
7 5
#
题意: 给出一个无向图, 去掉一些边后仍然是连通. 输出不可以转化为, 单向通道的边.
解题思路:
代码:
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
#define MAX 1005
const int INF = (1<<29);
struct node
{
}edges[MAX*10];
int n, m;
int first[MAX], num;
int bcc[MAX*10], bcnt, deep[MAX*10], low[MAX*10];
int stack[MAX*10], top;
bool instack[MAX*10], vis[MAX*10];
int start, fa_start;
void init()
{
}
inline void add(int u,int v)
{
}
void read_graph()
{
}
void tarjan(int u,int fa,int dfsindex)
{
}
void solve(int u,int fa)
{
}
int main()
{
//
}
- ACM: 无向图的强连通分量 图论题 p…
- ACM: 图论题 poj 2186 强连通分量
- ACM: 图论题 poj 1236 强连通
- ACM: 有向欧拉图 图论题 poj 1386 …
- ACM: 图论题 poj3259 bellman_ford…
- ACM: 图论题 poj 3…
- ACM: 图论题 poj 1…
- ACM: 图论题 poj 1…
- ACM: 图论题 BFS + STL + priority…
- ACM: 图论题 poj 2240 (floyd + ST…
- ACM: 图论题 poj 1789 (一次AC的水…
- ACM: 图论题 poj 2253 (poj上的dou…
- ACM: 匈牙利算法 图论题 poj 3041 …
- ACM: 差分约束 图论题 poj 2983 sp…
- ACM: 经过K条边的最短路 图论题 po…
- ACM: 二分图最佳匹配 图论题 poj 3…
- ACM: 二分图最大匹配 图论题 poj 2…
- ACM: 图论题 poj 1161 (把图重建成…
- ACM: 图论题 poj 1161 (把图重建成…
- spark-graphx新的里程碑GraphDataFrames
- ACM: 闭包问题 图论题 (书上练习)
- ACM: 广搜 图论题 poj 1708
- ACM: 最近公共祖先问题 图论题
- ACM: 无向图的强连通分量 图论题 p…
- ACM: 浙江省赛题目 22:00 ~ 3:00 (…
- 2012年广东ACM省赛赛后总结
- ACM: 动态规划题 toj 1511
- ACM: 动态规划题 toj 1545
- ACM: 简单DP 动态规划题 toj 1547
- ACM: DP训练好题 动态规划题 poj 1…
- ACM: 0-1背包变形 动态规划题 toj …
- ACM: 任意进制的小数转化 高精度题…