码迷,mamicode.com
首页 >  
搜索关键字:edge    ( 2375个结果
SDUT 2498-AOE网上的关键路径(spfa+字典序路径)
AOE网上的关键路径Time Limit: 1000ms Memory limit: 65536K有疑问?点这里^_^题目描写叙述 一个无环的有向图称为无环图(Directed Acyclic Graph),简称DAG图。 AOE(Activity On Edge)网:顾名思义,用边表示活动的网,当...
分类:其他好文   时间:2015-05-01 19:56:11    阅读次数:200
Out of Hay.(POJ-2395)
最小生成树kruskal算法。 首先必须形成一棵最小生成树,然后找出最长的路。 #include #include #include #include #include #include #include using namespace std; int n,m,a,b,c,par[1005],rankk[1005], max_road; struct edge { int u,v,c...
分类:其他好文   时间:2015-05-01 12:08:49    阅读次数:147
Build2015开发者大会亮点汇总
小弟刚入微软圈没多久,之前也很少关注有关微软的发布会,这次很荣幸能与诸大牛(珍惜、Eric、Jeff等等)守到凌晨观看实时大会进程,闲暇发文以表心意,嘿嘿!本次大会亮点频出,具体内容整理如下:1、Azure云计算业务成为微软重要业务。随着微软提出“移动为先,云为先”的战..
分类:其他好文   时间:2015-04-30 20:21:02    阅读次数:191
TSP模板
算法大意:从一个起点出发,到达所有需要达到的点,再回到本身,求最短路法一:用状态压缩思想#include#include#include#includeusing namespace std;int n;struct edge{ int x; int y;}a[20];int temp[...
分类:其他好文   时间:2015-04-28 17:27:59    阅读次数:149
最小生成树 并查集 最短路径
#include #include struct edge{ int u; int v; int w;//为了方便排序这里穿件一个结构体来存储边的关系 }e[10]; int n,m; int f[10]={0},sum=0,count=0;//并查集需要得到的一些变量 //f数组大小根据实际情况来设置,要比n的最大值大1 //排序 int cmp(const void *a,const voi...
分类:其他好文   时间:2015-04-28 16:11:27    阅读次数:124
邻接表模板
1.数组模拟链表实现struct edge{ int u,v,w,next;}a[MAX];int E,u,v,w;E = 0;memset(head,-1,sizeof(head));void add(int u,int v,int w){ a[E].u = u;a[E].v = v;...
分类:其他好文   时间:2015-04-28 15:46:26    阅读次数:146
phonegap环境搭建
大家还是要借鉴官网给的说明,附上链接地址: http://docs.phonegap.com/en/edge/guide_platforms_android_index.md.html#Android%20Platform%20Guide 安装所需要的JDK、ANT、android sdk我就不说什么了。。大家都...
分类:其他好文   时间:2015-04-28 00:25:30    阅读次数:210
Codeforces Round #179 (Div. 2)---D. Greg and Graph(离线+floyd)
Greg has a weighed directed graph, consisting of n vertices. In this graph any pair of distinct vertices has an edge between them in both directions. Greg loves playing with the graph and now he has in...
分类:其他好文   时间:2015-04-27 15:17:42    阅读次数:112
HackerRank - Cut the Tree
Typical tree recursion works. The key is: ANY node can be treated as the root, since it is about edge, not about node. This simplifies things a lot.#i...
分类:其他好文   时间:2015-04-27 14:59:09    阅读次数:120
对于树的直径的理解
定义:n个节点的树,任选一个节点V0,找到距离它最远的节点V1,再找距离V1最远的节点V2,edge(V1,V2) 即为树的直径. 理解:edge(V0,V1)一定会经过root(不理解的话你画个图试试~),则edge(root,V1)即为距离root最长,或次长的边. 因此,再从V1出发,找距离V1最远的节点V2,必定通过root,所以可以看成是找距离root最远的节点V2(不能回头搜索V1...
分类:其他好文   时间:2015-04-25 18:24:14    阅读次数:143
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!