
图论一顿套模板
文章平均质量分 92
花雨就是花雨
最好的我还未等到~
展开
-
POJ1789--Truck History(最小生成树)
Discussion Advanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing each原创 2017-07-29 09:54:11 · 728 阅读 · 0 评论 -
POJ3068--"Shortest" pair of paths(最小费用流)
Discussion A chemical company has an unusual shortest path problem. There are N depots (vertices) where chemicals can be stored. There are M individual shipping methods (edges) connecting pairs o原创 2017-10-26 21:26:14 · 505 阅读 · 0 评论 -
ALDS1_4_C Dictionary(哈希)
Discussion Your task is to write a program of a simple dictionary which implements the following instructions: insert str: insert a string str in to the dictionary find str: if the distionary c原创 2017-10-17 10:46:51 · 664 阅读 · 0 评论 -
POJ1273--Drainage Ditches(最大流)
Discussion Every time it rains on Farmer John’s fields, a pond forms over Bessie’s favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regr原创 2017-10-24 20:24:59 · 420 阅读 · 0 评论 -
POJ3041--二分图最大匹配模板
#include <cstdio>#include <iostream>#include <cstring>const int MAXN = 510;int uN,vN;int g[MAXN][MAXN];int linker[MAXN];bool used[MAXN];bool dfs(int u){ for(int v = 1; v <= vN;v++) if(原创 2017-10-28 13:11:38 · 382 阅读 · 0 评论 -
POJ2387--Til the Cows Come Home(dijkstra)
Description Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she w原创 2017-10-09 16:49:08 · 429 阅读 · 0 评论 -
HDU4857--逃生(反向拓扑)
Problem Description 糟糕的事情发生啦,现在大家都忙着逃命。但是逃命的通道很窄,大家只能排成一行。 现在有n个人,从1标号到n。同时有一些奇怪的约束条件,每个都形如:a必须在b之前。 同时,社会是不平等的,这些人有的穷有的富。1号最富,2号第二富,以此类推。有钱人就贿赂负责人,所以他们有一些好处。 负责人现在可以安排大家排队的顺序,由于收了好处,所以他要让1号原创 2017-08-23 12:51:03 · 612 阅读 · 0 评论 -
POJ3259--Wormholes(SPFA)
Do more with lessDescription While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to it原创 2017-08-23 10:38:12 · 465 阅读 · 0 评论 -
HDU2489--Minimal Ratio Tree(最小生成树)
Do more with lessDescription For a tree, which nodes and edges are all weighted, the ratio of it is calculated according to the following equation. Given a complete graph of n nodes with all原创 2017-08-14 19:00:29 · 453 阅读 · 0 评论 -
POJ2676--Sudoku(搜索)
搜索......原创 2017-05-15 21:54:34 · 326 阅读 · 0 评论 -
YTU3133--进阶递归之引爆炸弹(搜索)
搜索......原创 2017-05-16 09:27:23 · 762 阅读 · 0 评论 -
POJ2524--Ubiquitous Religions(并查集)
并查集......原创 2017-05-14 23:19:50 · 456 阅读 · 0 评论 -
POJ1088--滑雪(DP+搜索)
DP+搜索的简单组合原创 2017-05-31 14:26:43 · 465 阅读 · 0 评论 -
HDU1083--Courses(二分图最大匹配)
Description Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible to form a committee of exactly P stu原创 2017-06-15 12:57:28 · 436 阅读 · 0 评论 -
Dijkstra算法--邻接表存储+堆优化
//Dijkstra#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <vector>#include <queue>using namespace std;const int INF = 0x3f3f3f3f;const int MAX = 5005;typede原创 2017-12-10 15:05:09 · 687 阅读 · 0 评论