![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论
提比-我有特殊的AC技巧
这个作者很懒,什么都没留下…
展开
-
Reactor Cooling - sgu 194 无源汇可行流
Reactor Coolingtime limit per test: 0.5 sec.memory limit per test: 65536 KBinput: standardoutput: standardThe terrorist group leaded by a well known international terrorist Ben原创 2015-07-20 22:35:51 · 605 阅读 · 0 评论 -
King's Quest - POJ 1904 Tarjan强连通分量
King's QuestTime Limit: 15000MS Memory Limit: 65536KTotal Submissions: 7590 Accepted: 2753Case Time Limit: 2000MSDescriptionOnce upon a time there lived a原创 2015-02-24 16:01:26 · 481 阅读 · 0 评论 -
迷宫城堡 - HDU 1269 Tarjan 模板题
迷宫城堡Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8401 Accepted Submission(s): 3760Problem Description为了训练小希的方向感,Gardon建立了一原创 2015-02-23 19:04:21 · 493 阅读 · 0 评论 -
Popular Cows - POJ 2186 Tarjan
Popular CowsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 24359 Accepted: 9999DescriptionEvery cow's dream is to become the most popular cow in the原创 2015-02-24 16:45:29 · 388 阅读 · 0 评论 -
Network of Schools - POJ 1236 Tarjan 缩点
Network of SchoolsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11939 Accepted: 4759DescriptionA number of schools are connected to a computer netwo原创 2015-02-23 20:22:55 · 373 阅读 · 0 评论 -
Breaking Good - CodeForces 507E
Breaking Goodtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBreaking Good is a new video game which a lot原创 2015-02-22 14:29:00 · 548 阅读 · 0 评论 -
Dijkstra, Dijkstra. - UVa 10806 费用流
Problem ?Dijkstra, Dijkstra.Time Limit: 10 secondsDexter: "You don't understand. I can't walk...they've tied my shoelaces together."Topper Harley: "A knot. Bastards!"Jim Ab原创 2015-01-04 15:52:10 · 498 阅读 · 0 评论 -
Tanya and Password - CodeForces 508 D 欧拉路径
Tanya and Passwordtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhile dad was at work, a little girl Tan原创 2015-02-20 16:49:20 · 516 阅读 · 0 评论 -
Data Flow - UVa 10594 费用流
In the latest Lab of IIUC, it requires to send huge amount of data from the local server to the terminal server. The lab setup is not yet ready. It requires to write a router program for the best path原创 2015-02-09 17:47:48 · 544 阅读 · 0 评论 -
Power Transmission - UVa 10330 最大流
Power Transmission The ProblemDESA is taking a new project to transfer power. Power is generated by the newly established plant in Barisal. The main aim of this project is to transfer Power原创 2015-01-04 15:47:18 · 549 阅读 · 0 评论 -
Thunder Mountain - UVa 10803 Floyd
Problem ?Thunder MountainTime Limit: 3 seconds"I mean, some people got guns, and somepeople got flashlights, and some people got batteries. These guys had all three."J. Mic原创 2015-01-02 16:44:52 · 519 阅读 · 0 评论 -
Numbering Paths - UVa 125 Floyd求环
Numbering PathsBackgroundProblems that process input and generate a simple ``yes'' or ``no'' answer are called decision problems. One class of decision problems, the NP-complete problems, ar原创 2015-01-02 15:42:48 · 490 阅读 · 0 评论 -
Arbitrage - UVa 104 Floyd变形
ArbitrageBackgroundThe use of computers in the finance industry has been marked with controversy lately as programmed trading -- designed to take advantage of extremely small fluctuations in原创 2015-01-02 14:37:24 · 568 阅读 · 0 评论 -
Crime Wave – The Sequel - UVa 10746 费用流
Crime Wave – The SequelInput: Standard InputOutput: Standard OutputTime Limit: 2 Seconds n banks have been robbed this fine day. m (greater than or equal to n) police cruisers are on duty原创 2015-02-09 17:46:11 · 609 阅读 · 0 评论 -
Drainage Ditches - HDU 1532 最大流
Drainage DitchesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10124 Accepted Submission(s): 4819Problem DescriptionEvery ti原创 2015-01-03 14:47:25 · 509 阅读 · 0 评论 -
King - UVa 515 差分约束系统
KingOnce, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed: ``If my child was a son and if only he was a sound king.'' After nine months her child was born原创 2015-01-01 16:48:02 · 463 阅读 · 0 评论 -
Fox And Dinner - CodeForces 510 E dinic 网络流 奇偶匹配
Fox And Dinnertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is participating in a party in Prim原创 2015-02-07 15:46:10 · 779 阅读 · 0 评论 -
Wormholes - UVa 558 spfa判断负环
WormholesIn the year 2163, wormholes were discovered. A wormhole is a subspace tunnel through space and time connecting two star systems. Wormholes have a few peculiar properties:Wormholes原创 2015-01-01 16:41:58 · 584 阅读 · 0 评论 -
Going from u to v or from v to u? - POJ 2762 Tarjan+拓扑排序
Going from u to v or from v to u?Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14959 Accepted: 3956DescriptionIn order to make their sons brave, Jia原创 2015-02-24 18:29:55 · 549 阅读 · 0 评论 -
Rings'n'Ropes - UVa 10985 Floyd
Rings'n'RopesTime Limit: 3 seconds"Well, that seems to be the situation. But,I don't want that, and you don't want that,and Ringo here definitely doesn't want that."Jules Win原创 2015-02-12 16:23:06 · 556 阅读 · 0 评论 -
Ants - POJ 3565 KM算法
AntsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 4699 Accepted: 1479 Special JudgeDescriptionYoung naturalist Bill studies ants in school. His原创 2015-07-06 21:57:21 · 480 阅读 · 0 评论 -
Going Home - POJ 1295 KM算法
Going HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 19296 Accepted: 9810DescriptionOn a grid map there are n little men and n houses. In each un原创 2015-07-06 20:47:12 · 639 阅读 · 0 评论 -
Another Minimum Spanning Tree - UVaLive 3662 曼哈顿最小生成树
For a given point set P = {(xi, yi) : 1 i n}, then construct a complete graph G = (V, E, W) with nvertexes. The weight function for any two vertexes is w(vi, vj) = | xi - xj| + | yi - yj|. Pleas原创 2015-06-14 12:27:03 · 556 阅读 · 0 评论 -
Object Clustering - POJ 3241 曼哈顿最小生成树
Object ClusteringTime Limit: 2000MS Memory Limit: 131072KTotal Submissions: 1641 Accepted: 401DescriptionWe have N (N ≤ 10000) objects, and wish to classify the原创 2015-06-12 12:52:04 · 393 阅读 · 0 评论 -
The Windy's - POJ 3686 KM算法
The Windy'sTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 4408 Accepted: 1874DescriptionThe Windy's is a world famous toy factory that owns M top-cla原创 2015-07-07 20:31:30 · 493 阅读 · 0 评论 -
Random Maze - HDU 4067 最小费用最大流
Random MazeTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1347 Accepted Submission(s): 501Problem DescriptionIn the game “A原创 2015-05-19 12:37:14 · 424 阅读 · 0 评论 -
Command Network - POJ 3164 朱刘算法
Command NetworkTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 14424 Accepted: 4151DescriptionAfter a long lasting war on words, a war on arms fina原创 2015-06-04 10:19:45 · 402 阅读 · 0 评论 -
Ice_cream’s world II - HDU 2121 朱刘算法
Ice_cream’s world IITime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3398 Accepted Submission(s): 812Problem DescriptionAfter原创 2015-06-04 10:21:29 · 440 阅读 · 0 评论 -
March of the Penguins - UVa 12125 网络流
March of the PenguinsTime limit: 4 secondsSomewhere near the south pole, a number of penguins are standing on a number of ice floes. Being social animals, the penguins would like to get together原创 2015-06-02 14:52:49 · 558 阅读 · 0 评论 -
Guardian of Decency - UVa 12083 二分图最大独立点集
题意:一些男生和一些女生出去旅游,如果任意两个人满足规定的四条之一就可以一起出去玩。问最多可以去多少人。思路:求一个二分图的最大匹配。然后用总人数减去这个匹配对数就是最大独立点集。AC代码如下:#include#include#include#include#includeusing namespace std;struct node{ int h,music,s原创 2015-06-02 15:27:30 · 489 阅读 · 0 评论 -
Adventurous Driving - POJ 2679 最短路+负环
Adventurous DrivingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1511 Accepted: 426DescriptionAfter a period of intensive development of the transpo原创 2015-06-02 20:41:44 · 727 阅读 · 0 评论 -
Objective: Berlin - UVa 1161 Dinic
题意:对于每个班机有限制的人数,开始时间和结束时间,倒班机的间隔需要至少30分钟,问在限制时间内坐飞机从起点到终点最多有多少。思路:dinic最大流,将每个班机作为一个点,并且拆点成i'和i'',从i'->i''的边的限制为班机的人数,两个班机i和j如果i的终点是j的起点,且时间间隔至少为30分钟则在i''->j'建立边,最后是源点和汇点的边。AC代码如下:#include#incl原创 2015-05-18 23:26:28 · 445 阅读 · 0 评论 -
X-Plosives - UVa 并查集
题意:给定每组有两个数字,且每组的数字都不相同,假设有n组共有n个不同的数字则会发生爆炸,这一组便不予接受,否则则接受。问有多少组不接受。思路:用并查集,假设有两个数字已经在同一组了,那么就会出现环。AC代码如下:#include#include#include#includeusing namespace std;typedef long long ll;int T,t,原创 2015-06-01 15:44:51 · 457 阅读 · 0 评论 -
Destroying Roads - CodeForces 543 B
Destroying Roadstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn some country there are exactly n cities原创 2015-05-16 12:49:36 · 1094 阅读 · 1 评论 -
Cable TV Network- POJ 1966 连通量
Cable TV NetworkTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 4068 Accepted: 1903DescriptionThe interconnection of the relays in a cable TV network原创 2015-03-25 09:44:58 · 500 阅读 · 0 评论 -
Adventure of Super Mario - UVa 10269 Floyd+Dijkstra
题意:有n个村庄,m个城堡,马里奥需要从n+m点的城堡回到1的村庄,同时,他有一双鞋每次使用可以连续飞行不超过L的距离,但是起点和终点必须是村庄或城堡,并且中间不能经过城堡,而且最多用k次,问他回到家的最短时间是多少。思路:首先Floyd找出所有只以村庄作为中转点的每两个点间的最短距离,然后dp[u][k]表示到u点并且鞋子还可以用k次的最少花费时间。通过Dijkstra求得最后的答案。A原创 2015-03-18 17:50:18 · 485 阅读 · 0 评论 -
"Shortest" pair of paths - POJ 3068 费用流
"Shortest" pair of pathsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1066 Accepted: 421DescriptionA chemical company has an unusual shortest path p原创 2015-03-20 22:34:28 · 576 阅读 · 0 评论 -
Fox And Names - CodeForces 510 C
Fox And Namestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is going to publish a paper on FOCS原创 2015-02-03 17:28:30 · 536 阅读 · 0 评论 -
Crimewave - UVa 563 dinic网络流
CrimewaveNieuw Knollendam is a very modern town. This becomes clear already when looking at the layout of its map, which is just a rectangular grid of streets and avenues. Being an important tra原创 2015-02-01 14:56:57 · 530 阅读 · 0 评论 -
Wormholes - POJ 3259 spfa
WormholesTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 31588 Accepted: 11495DescriptionWhile exploring his many farms, Farmer John has discovered a原创 2014-10-01 15:00:52 · 516 阅读 · 0 评论