![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论
JOY酷酷
这个作者很懒,什么都没留下…
展开
-
LeetCode 207.Course Schedule
题目链接https://leetcode.com/problems/course-schedule/题意一共有 numCourses 门课程,一些课程必须学完前置课程才能够学习,问是否能学完所有课程。比如:course0 的前置课程是 course1,而 course1 的前置课程是 course0,则无法学完。思路这道题就是给出了一个有向图判断是否成环。这里需要对一个有向无环图进行拓扑...原创 2020-01-29 21:11:53 · 146 阅读 · 0 评论 -
POJ 3041 Asteroids(二分图匹配)
DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are conv原创 2016-11-02 16:32:25 · 345 阅读 · 0 评论 -
HDU 5855 Less Time, More profit(网络流)
Problem DescriptionThe city planners plan to build N plants in the city which has M shops.Each shop needs products from some plants to make profit of proi units.Building ith plant needs inve原创 2016-08-17 15:39:50 · 429 阅读 · 0 评论 -
POJ 1273 Drainage Ditches(最大流模板)
DescriptionEvery 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 r原创 2016-08-15 16:54:29 · 188 阅读 · 0 评论 -
CodeForces 689B Mike and Shortcuts(SPFA)
题目链接:http://codeforces.com/problemset/problem/689/B题意:设从i到j需要 |i-j| 点体力,从i有一条捷径到Ai,只需1点体力。输入A1-An,输出从1到i的最少花费。思路:1->3若没有捷径则相当于1->2->3,所以对于i点只需要建立三条边。i -> Ai、i -> i-1、i -> i+1,然后用SPFA求最短路即可。原创 2016-07-19 10:52:54 · 232 阅读 · 0 评论 -
20150728多校第三场1011 - work
Problem DescriptionIt’s an interesting experience to move from ICPC to work, end my college life and start a brand new journey in company.As is known to all, every stuff in a company has a title,原创 2015-07-28 23:59:28 · 562 阅读 · 0 评论 -
hdu1142 - A Walk Through the Forest(SPFA+记忆化搜索)
A Walk Through the ForestTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3018 Accepted Submission(s): 1101Problem DescriptionJimmy ex原创 2015-07-29 23:51:14 · 428 阅读 · 2 评论 -
20150419武大邀请赛之网络赛 C - Spanning Tree
DescriptionYou are given a graph with N nodes and M edges.Then every time you are required to add an additional edge with weight Wi connecting the node Ai and Bi in the graph, and then calculate the...原创 2015-04-21 22:41:59 · 400 阅读 · 0 评论 -
Codeforces 501 B - Misha and Changing Handles
DescriptionMisha hacked the Codeforces site. Then he decided to let all the users change their handles. A user can now change his handle any number of times. But each new handle must not be equal to原创 2015-05-01 01:01:58 · 602 阅读 · 0 评论 -
POJ 1661 Help Jimmy (图论SPFA)
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uDescription"Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台,高度为零,长度无限。 Jimmy老鼠在时刻0从高于所有平台的某处开始下落,它的下落速度始原创 2015-08-18 14:54:45 · 362 阅读 · 0 评论