![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM图论
ipqhjjybj
学生
展开
-
NEU 1222: Sweep the snow PRIM()
题目描述:After the big big snow yesterday, NEU became a beautiful silver world.In the morning, poor michaelalan got a short message which told him to sweep the whole school snow and make the traffic u原创 2013-06-20 21:07:53 · 1330 阅读 · 0 评论 -
HDU 1878 欧拉回路 Tarjan+欧拉判定
题目描述:欧拉回路是指不令笔离开纸面,可画过图中每条边仅一次,且可以回到起点的一条回路。现给定一个图,问是否存在欧拉回路?Input:测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是节点数N ( 1 束。/** * 欧拉回路 无向图判定条件 * 1、度数为奇数的点的个数为0 * 2、图是连通的 * * 有向图判定条件:原创 2013-06-27 00:05:15 · 1217 阅读 · 0 评论 -
HDU 3549 Flow Problem 最大流 最小增广路 DINIC算法 也是46MS
http://blog.csdn.net/ipqhjjybj/article/details/9172347不说什么啦。。。这个直接是套模板的,就是前期优化了一点点,把重复边都合并了,效率提升挺明显的。 从472MS提高到了62MS,后来将 memset(a,0,sizeof(a));这样的写法改成了memset(a,0,(n+1)*sizeof(int)); 时间从 62MS 调高到了46原创 2013-06-26 18:54:30 · 1462 阅读 · 0 评论 -
HDU 3549 Flow Problem 最大流 最小增广路 EK算法 传说中的入门算法
题目描述Network flow is a well-known difficult problem for ACMers. Given a graph, your task is to find out the maximum flow for the weighted directed graph.Input:The first line of input contains a原创 2013-06-25 16:39:26 · 1541 阅读 · 0 评论 -
HDU 3549 Flow Problem 最大流 最小增广路 SAP算法 从EK算法的753MS降到了46MS
EK 算法的链接:http://blog.csdn.net/ipqhjjybj/article/details/9171181SAP算法果然对这个优化了好多。。时间直接从753MS降到46MS呀。。题目描述Network flow is a well-known difficult problem for ACMers. Given a graph, your task i原创 2013-06-25 17:37:34 · 1946 阅读 · 0 评论 -
HDU 2767 Proving Equivalences Tanjan+缩点 直接当缩点的模板吧
#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;#define inf 0x3f原创 2013-06-25 00:24:01 · 1474 阅读 · 0 评论 -
HDU 2444 The Accomodation of Students 判断二分图 + 最大匹配
Problem DescriptionThere are a group of students. Some of them may know each other, while others don't. For example, A and B know each other, B and C know each other. But this may not imply that A a原创 2013-06-23 22:34:37 · 1195 阅读 · 0 评论 -
HDU 3390 Railway 边双连通分量
题目描述:There are some locations in a park, and some of them are connected by roads. The park manger needs to build some railways along the roads, and he would like to arrange tourist routes to each circ原创 2013-06-22 10:25:14 · 1895 阅读 · 0 评论 -
HDU 1269 迷宫城堡 强连通分量模板题
题目描述 : 为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(NInput:输入包含多组数据,输入的第一行有两个数:N和M,接下来的M行每行有两个数a和b,表示了一条通道可以从A房间来到B房间。文件最后以两个0结束。Output:对于输入的每组数据,如果任意两个房间都是相互连接的,输出"Yes",否则输出"No"。Sample Input:原创 2013-06-22 21:44:21 · 1383 阅读 · 0 评论 -
NEU 1253 线段树
题目描述: Do you know LiuJishou? He is a man who is famous of evaluting netizens' appearance on Sina Weibo. One day, LZ wants to simulate LiuJishou and he evalutes N(1<=N<=50,000) girls appearance.原创 2013-06-20 21:04:43 · 1100 阅读 · 0 评论 -
HDU3836 Tarjan缩点
/* 通过强连通分量Tarjan算法后,进行缩点,然后算强连通点的入度跟出度的分量数目即可。 答案即为入度为0或出度为0的点数目的最大值。 这点可以将缩点后图形堪称有向无环图,仿照树的定义,根为入度为0的点,叶子为出度为0的点。很明显的,要使其成为强连通图,令f为树根数,g为叶子数,则答案为max(f,g),特别的,当缩点只有一个点时,答案为0.*//* * @au原创 2013-06-20 13:20:14 · 1317 阅读 · 0 评论 -
POJ 2230 Watchcow 欧拉路径 DFS
题目描述:Bessie's been appointed the new watch-cow for the farm. Every night, it's her job to walk across the farm and make sure that no evildoers are doing any evil. She begins at the barn, makes her原创 2013-06-27 12:50:18 · 1388 阅读 · 0 评论