
连通图
文章平均质量分 53
LeeBooL
这个作者很懒,什么都没留下…
展开
-
Air Raid
一个有向图,且我们要注意一句话. Each paratrooper lands at an intersection and can visit other intersections following the town streets. 所以我们要先把所有能通向的点都连上边,然后最小点覆盖#include #include #include #include using n原创 2015-03-26 00:00:57 · 539 阅读 · 0 评论 -
poj 2186
Popular CowsTime Limit: 2000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionEvery cow's dream is to become the most popular cow原创 2015-03-16 22:52:24 · 309 阅读 · 0 评论 -
HDU 4635 Strongly connected
G - Strongly connected Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 4635 Description Give a simple directed graph with N nodes and M edges. P原创 2015-03-21 00:26:01 · 333 阅读 · 0 评论 -
POJ 3694 Network
D - Network Time Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 3694 Description A network administrator manages a large network. The network consis原创 2015-03-21 00:36:17 · 329 阅读 · 0 评论 -
HDU 4612 Warm up
Description N planets are connected by M bidirectional channels that allow instant transportation. It’s always possible to travel between any two planets through these channels. If we can isolat原创 2015-03-21 00:48:08 · 335 阅读 · 0 评论 -
Knights of the Round Table
点双联通分量+二分图染色1、首先根据题目给出的憎恨关系建图,然后求补图,这个图表示哪个骑士可以和哪个骑士坐在一起。2、在图中求出圈,也就是双联通分量,这可以用到Tarjan算法的思想,通过Tarjan算法执行过程中退栈求出一个又一个双联通分量。3、对于双联通分量我们需要在其中找到一个奇圈,这需要一个利用了DFS的交叉染色法,在代码中我建补图的时候没有建立自己和自己的边,当用这个方法找出来的奇圈原创 2015-03-21 23:52:38 · 344 阅读 · 0 评论 -
*POJ 3177 Redundant Paths**
POJ 3177 Redundant Paths 这道题是求一个变双联通分量,问你,最少加多少条边,可以使任意两个节点之间可以有两条路径 首先我们要知道,通过联通分量缩点以后我们可以形成一棵树,那么树的叶子节点数为cnt, (cnt+1)/2 便是答案, 然后就是Trajan求割边了,#include <iostream>#include <stdlib.h>#incl原创 2015-03-18 23:58:04 · 357 阅读 · 0 评论 -
HDU Caocao's Bridges
题意挺简单的但是有好多细节要处理好,就是让求所有割边最小权值 1)自环 2)如果地图根本不是一个联通图那么我们根本不需要炸,答案就是0 3)如果路上的侍卫是0,那么我们至少需要一个人去被炸, 此时答案是1 4)其他情况就正常来就行,求割边#include <iostream>#include <stdlib.h>#include <stdio.h>#include <string.h>原创 2015-03-19 00:04:57 · 541 阅读 · 0 评论 -
URAL - 1949 The Best Picture in the Galaxy
传送门:http://acm.timus.ru/problem.aspx?space=1&num=1949 题意 : k 个学生去看n个电影,每个电影有自己的开始时间,结束时间和女演员数目,并且,要保证一个学生同时不能看两场电影,其次,学生看的第i+1个电影的女演员数目要不小于他看的第i的电影的女演员数。 求看最多的电影数目时,看了那几部,没看哪几部,1 表示看过0表示没看过思路:二分图,但是要原创 2015-08-15 13:59:20 · 605 阅读 · 0 评论