码迷,mamicode.com
首页 >  
搜索关键字:moral graph    ( 3648个结果
[LintCode] Find the Weak Connected Component in the Directed Graph
Find the number Weak Connected Component in the directed graph. Each node in the graph contains a label and a list of its neighbors. (a connected set ...
分类:其他好文   时间:2015-09-01 21:12:12    阅读次数:344
HDU 4365——Palindrome graph——————【规律+快速幂】
Palindrome graphTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1727Accepted Submission(s): 525Pro...
分类:其他好文   时间:2015-09-01 01:35:35    阅读次数:199
HDU5424——DFS——Rikka with Graph II
http://acm.hdu.edu.cn/showproblem.php?pid=5424/*对于一个连通图,有N个顶点,如果有N条边,那么肯定有环因为N个点如果不成环最多N-1条边。。。然后找最小度的点DFS就行。。。 *//***********************************...
分类:其他好文   时间:2015-08-31 21:09:58    阅读次数:96
hdu 5424 Rikka with Graph II (BestCoder Round #53 (div.2))(哈密顿通路判断)
http://acm.hdu.edu.cn/showproblem.php?pid=5424哈密顿通路:联通的图,访问每个顶点的路径且只访问一次n个点n条边n个顶点有n - 1条边,最后一条边的连接情况:(1)自环(这里不需要考虑);(2)最后一条边将首和尾连接,这样每个点的度都为2;(3)最后一条...
分类:其他好文   时间:2015-08-31 19:12:02    阅读次数:130
poj 1679 The Unique MST
题目连接http://poj.org/problem?id=1679The Unique MSTDescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique.Definition ...
分类:其他好文   时间:2015-08-31 16:52:10    阅读次数:123
BestCoder Round #53
HDU 5424 Rikka with Graph II 【题目链接】:click here~~ 代码: #include using namespace std; const int N=1005; vector g[N]; bool vis[N]; int dg[N]; int cnt; int n,u,v; bool ok; void dfs(int u,int cur) { ...
分类:其他好文   时间:2015-08-31 01:14:10    阅读次数:274
Easy Graph Problem?(一道简单图论题?) bfs + 优先队列
Easy Graph Problem?题目抽象:给你一个n * m 的矩阵.每个格子是数字或者障碍物'*'. 第一问:从起点到终点的最短路.第二问:要求相同的方向不能连续走两次,也就是每到达一个格子,需要改变方向.问最短路. 不过不存在就输出-1.分析:可以直...
分类:其他好文   时间:2015-08-31 00:47:19    阅读次数:239
HDU 5422-Rikka with Graph(规律题)
题目地址:HDU 5422 题意: 思路: 如果连上1-n的边,最短距离就是1。所以所有情况下最短距离都是1。考虑方案数,如果本来没有1-n的边,那么只能连1-n,方案数为1。否则怎么连都可以,方案数是n*(n-1)/2。int main() { int n,m; int x,y; while(~scanf("%d %d",&n,&m)) { int...
分类:其他好文   时间:2015-08-30 19:38:42    阅读次数:134
SDUT 3315 a
We have a graph with size = N like that in Figure 1. Then we are going to find a downward path from the top node to one bottom node.    First, we select the top node as the beginning. Then at any no...
分类:其他好文   时间:2015-08-30 19:35:58    阅读次数:185
数据结构--图(下)--拓扑排序
拓扑排序思维导图也是图的一种拓扑序:如果图中从V到W有一条有向路径,则V一定排在W之前。满足此条件的顶点排序成为一个拓扑序。 V-》W获得一个拓扑序的过程就是拓扑排序AOV如果有合理的拓扑序,则必定是有向无环图(Directed Acyclic Graph,简称DAG)。第一排没有预修课程的课。然后...
分类:编程语言   时间:2015-08-30 19:13:52    阅读次数:294
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!