随笔分类 -  图论

摘要:Problem Description 度度熊国王率领着喵哈哈族的勇士,准备进攻哗啦啦族。 哗啦啦族是一个强悍的民族,里面有充满智慧的谋士,拥有无穷力量的战士。 所以这一场战争,将会十分艰难。 为了更好的进攻哗啦啦族,度度熊决定首先应该从内部瓦解哗啦啦族。 第一步就是应该使得哗啦啦族内部不能同心齐力 阅读全文
posted @ 2017-08-10 18:17 Oyking 阅读(1168) 评论(0) 推荐(3) 编辑
摘要:前言 StoerWagner算法是一个找出无向图全局最小割的算法,本文需要读者有一定的图论基础。 本文大部分内容与词汇来自参考文献(英文,需科学上网),用兴趣的可以去读一下文献。 概念 无向图的割 :有无向图$G=(V,E)$,设$C$为图$G$中一些弧的集合,若从$G$中删去$C$中的所有弧能使图 阅读全文
posted @ 2017-08-10 14:33 Oyking 阅读(8687) 评论(0) 推荐(5) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5458Problem DescriptionGiven an undirected connected graphGwithnnodes andmedges, with possibly repeated... 阅读全文
posted @ 2015-09-19 17:51 Oyking 阅读(829) 评论(3) 推荐(1) 编辑
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=648&page=show_problem&problem=5150题目大意:给一幅N个点M条边的无向图,有一些边,其... 阅读全文
posted @ 2015-06-24 20:42 Oyking 阅读(947) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3781Leo has a grid withNrows andMcolumns. All cells are painted with either black or... 阅读全文
posted @ 2015-04-16 00:08 Oyking 阅读(450) 评论(0) 推荐(0) 编辑
摘要:比赛笔试链接:http://hihocoder.com/contest/ntest2015april/problems题目就不贴了。1、推箱子。思路:纯模拟。代码(28MS): 1 #include 2 using namespace std; 3 4 const int MAXV = 1001... 阅读全文
posted @ 2015-04-08 22:35 Oyking 阅读(4787) 评论(4) 推荐(0) 编辑
摘要:DescriptionSC省MY市有着庞大的地下水管网络,嘟嘟是MY市的水管局长(就是管水管的啦),嘟嘟作为水管局长的工作就是:每天供水公司可能要将一定量的水从x处送往y处,嘟嘟需要为供水公司找到一条从A至B的水管的路径,接着通过信息化的控制中心通知路径上的水管进入准备送水状态,等到路径上每一条水管... 阅读全文
posted @ 2015-02-17 16:41 Oyking 阅读(258) 评论(0) 推荐(0) 编辑
摘要:In a highly modernized fishing village, inhabitants there make a living on fishery. Their major tools, fishing nets, are produced and fixed by compute... 阅读全文
posted @ 2015-02-05 18:39 Oyking 阅读(428) 评论(1) 推荐(0) 编辑
摘要:题目链接:http://www.spoj.com/problems/COT2/You are given a tree withNnodes.The tree nodes are numbered from1toN.Each node has an integer weight.We will as... 阅读全文
posted @ 2015-02-01 17:36 Oyking 阅读(1965) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=3241DescriptionWe haveN(N≤ 10000) objects, and wish to classify them into several groups by judgement of their resembla... 阅读全文
posted @ 2015-01-31 21:34 Oyking 阅读(268) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4822Problem DescriptionThree countries, Red, Yellow, and Blue are in war. The map of battlefield is a t... 阅读全文
posted @ 2014-08-16 15:18 Oyking 阅读(1055) 评论(0) 推荐(0) 编辑
摘要:Problem Description瑶瑶(tsyao)是某知名货运公司(顺丰)的老板,这个公司很大,货物运输量极大,因此公司修建了许多交通设施,掌控了一个国家的交通运输。这个国家有n座城市,公司的总部在1号城市。公司下管辖的有m条道路和n-1段火车线路。这m条道路和n-1条火车线路都可以用u来表示... 阅读全文
posted @ 2014-08-07 17:18 Oyking 阅读(353) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionAlice and Bob are playing together. Alice is crazy about art and she has visited many museums around the world. She has a good memo... 阅读全文
posted @ 2014-08-05 20:11 Oyking 阅读(298) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1416Zaphod Beeblebrox — President of the Imperial Galactic Government. And by chance he is an owner ... 阅读全文
posted @ 2014-07-24 14:57 Oyking 阅读(337) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acdream.info/problem?pid=1128Problem Descriptionwuyiqi陷入了一个迷宫中,这个迷宫是由N*M个格子组成的矩阵。每个格子上堆放了一定数量的箱子。(i,j)表示第i行,第j列的格子。wuyiqi可以将一个格子上的箱子移动到相邻的... 阅读全文
posted @ 2014-07-22 16:06 Oyking 阅读(293) 评论(0) 推荐(0) 编辑
摘要:Problem Description 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,glo... 阅读全文
posted @ 2014-05-27 23:42 Oyking 阅读(1092) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionRompire is a robot kingdom and a lot of robots live there peacefully. But one day, the king of Rompire was captured by human beings. His thinking circuit was changed by human and thus became a tyrant. All those who are against him were put into jail, including our clever Micheal#1 阅读全文
posted @ 2014-04-06 22:32 Oyking 阅读(332) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionCity C is really a nightmare of all drivers for its traffic jams. To solve the traffic problem, the mayor plans to build a RTQS (Real Time Query System) to monitor all traffic situations. City C is made up of N crossings and M roads, and each road connects two crossings. All roads 阅读全文
posted @ 2014-04-04 20:45 Oyking 阅读(468) 评论(0) 推荐(0) 编辑
摘要:Problem Description You may not hear about Nubulsa, an island country on the Pacific Ocean. Nubulsa is an undeveloped country and it is threatened by 阅读全文
posted @ 2014-03-16 23:15 Oyking 阅读(964) 评论(0) 推荐(0) 编辑
摘要:In the present world you frequently meet a lot of call numbers and they are going to be longer and longer. You need to remember such a kind of numbers. One method to do it in an easy way is to assign letters to digits as shown in the following picture:1 ij 2 abc 3 def4 gh 5 kl 6 mn7 prs ... 阅读全文
posted @ 2014-02-22 22:10 Oyking 阅读(1573) 评论(0) 推荐(0) 编辑