![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论~
文章平均质量分 79
laserss
laserss@qq.com
展开
-
pku1659Frogs' Neighborhood 可图定理
pku1659n个点的度从大到小排序从中出去第一个点 并抹去边 (类似拓扑排序)序列中的所有数都为0 或 出现负数#include#include#include#includeusing namespace std;struct point{ int n,num;}P[11];bool cmp(point a,point b){ return a.num>b原创 2012-11-27 16:49:47 · 752 阅读 · 0 评论 -
最短路一个的细节
没次求最近点的时候都赋值为-1 ,循环结束后还是-1的话 return -1有特殊的作用原创 2012-11-30 21:39:27 · 664 阅读 · 1 评论 -
hdu2586 How far away? LCA
hdu2586#include#include#include#includeusing namespace std;#define MAX 40000struct edge{ int v,w;};vector mp[MAX];vector query[MAX];bool flag[MAX];int pre[MAX],father[MAX],path[MAX]原创 2012-12-03 11:35:42 · 1868 阅读 · 0 评论 -
hdu2586 LCA模板
hdu2586先预处理然后是 在线询问 (也就是一边读入一边查询)#pragma comment(linker, "/STACK:1024000000,1024000000")#include #include #include using namespace std;#define maxn 400010int n;struct Nod原创 2012-12-06 17:27:26 · 4593 阅读 · 1 评论 -
hdu1269 Tarjan强连通分量 模板
hdu1269资料师兄给的模板/*2012-12-06 20:16:08 Accepted 1269 46MS 1484K 1339 B C++*/#include #include #include using namespace std;#define maxn 10010int n;vector g[maxn];int Bcnt;原创 2012-12-06 21:59:38 · 4011 阅读 · 1 评论