ACM: 图论题 poj 1236 强连通
来源:互联网 发布:java酒店管理系统程序 编辑:程序博客网 时间:2024/05/17 18:15
Description
You are to write a program that computes the minimal number ofschools that must receive a copy of the new software in order forthe software to reach all schools in the network according to theagreement (Subtask A). As a further task, we want to ensure that bysending the copy of new software to an arbitrary school, thissoftware will reach all schools in the network. To achieve thisgoal we may have to extend the lists of receivers by new members.Compute the minimal number of extensions that have to be made sothat whatever school we send the new software to, it will reach allother schools (Subtask B). One extension means introducing one newmember into the list of receivers of one school.
Input
Output
Sample Input
5
2 4 3 0
4 5 0
0
0
1 0
Sample Output
1
2
题意: n个学校要进行软件维护, 软件进行拷贝, 并且每个学校有自己的维护表(拷贝软件给其它学校),
解题思路:
代码:
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
#define MAX 105
int n;
int g[MAX][MAX];
int dfn[MAX], low[MAX];
int stack[MAX], bcc[MAX], count, top;
bool vis[MAX];
int in[MAX], out[MAX];
inline int min(int a, int b)
{
}
void readGraph()
{
}
void tarjan(int u, int deep)
{
}
void solve()
{
}
int main()
{
//
}
- ACM: 图论题 poj 1236 强连通
- ACM: 图论题 poj 2186 强连通分量
- ACM: 无向图的强连通分量 图论题 p…
- ACM: 图论题 poj 2240 (floyd + ST…
- ACM: 图论题 poj 1135
- ACM: 图论题 poj 3…
- ACM: 图论题 poj 1…
- ACM: 图论题 poj 1…
- ACM: 二分法 数论题 poj 1905
- ACM: 匈牙利算法 图论题 poj 3041 …
- ACM: 差分约束 图论题 poj 2983 sp…
- ACM: 有向欧拉图 图论题 poj 1386 …
- ACM: 图论题 poj 3177 同 3352
- ACM: 图论题 poj 2253 (poj上的dou…
- ACM: polay定理 数论题 poj 1286 …
- ACM: 二分图最佳匹配 图论题 poj 3…
- ACM: 二分图最大匹配 图论题 poj 2…
- ACM: 图论题 poj 1161 (把图重建成…
- dos批处理中%~dp0%的说明
- ACM: 图论题 poj 3308 最大流问题
- ACM: 搜索题 poj 1020
- ACM: 图论题 poj 1201 差分约束
- ACM: 图论题 poj 1149 网络流问题
- ACM: 图论题 poj 1236 强连通
- ACM: 图论题 poj 1275 差分约束题
- 图论: 差分约束系统
- ACM: 图论题 poj 1…
- ACM: 图论题 poj 1466 最大独立团
- ACM: 图论题 poj 1…
- ACM: 动态规划题 sicily…
- ACM: 动态规划题 《黑书…
- CSDN博客关注点