图论
无语_
无语
展开
-
ACM程序设计选修课——Problem F:(ds:图)旅游规划(优先队列+SPFA)
问题 F: (ds:图)旅游规划时间限制: 1 Sec 内存限制: 128 MB提交: 14 解决: 4题目描述有了一张自驾旅游路线图,你会知道城市间的高速公路长度、以及该公路要收取的过路费。现在需要你写一个程序,帮助前来咨询的游客找一条出发地和目的地之间的最短路径。如果有若干条路径都是最短的,那么需要输出最便宜的一条路径。输入原创 2016-05-24 21:09:18 · 1046 阅读 · 0 评论 -
HDU——2647Reward(DFS或差分约束)
RewardTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7078 Accepted Submission(s): 2205Problem DescriptionDandelion's uncle i原创 2016-06-26 00:24:26 · 522 阅读 · 0 评论 -
NYOJ——239月老的难题(二分图最大匹配)
月老的难题 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 月老准备给n个女孩与n个男孩牵红线,成就一对对美好的姻缘。现在,由于一些原因,部分男孩与女孩可能结成幸福的一家,部分可能不会结成幸福的家庭。现在已知哪些男孩与哪些女孩如果结婚的话,可以结成幸福的家庭,月老准备促成尽可能多的幸福家庭,请你帮他找出最多可能促成的幸福家庭数量吧。假设男孩们分别编号为1~n,女原创 2016-06-24 20:44:12 · 499 阅读 · 0 评论 -
HDU——1045Fire Net(最大匹配)
Fire NetTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9897 Accepted Submission(s): 5750Problem DescriptionSuppose that we h原创 2016-07-15 23:32:22 · 473 阅读 · 0 评论 -
HDU——2444The Accomodation of Students(BFS判二分图+最大匹配裸题)
The Accomodation of StudentsTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4915 Accepted Submission(s): 2260Problem Description原创 2016-07-16 11:19:19 · 436 阅读 · 0 评论 -
PAT天梯赛练习题——L3-005. 垃圾箱分布(暴力SPFA)
L3-005. 垃圾箱分布时间限制200 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越大家倒垃圾的时候,都希望垃圾箱距离自己比较近,但是谁都不愿意守着垃圾箱住。所以垃圾箱的位置必须选在到所有居民点的最短距离最长的原创 2016-06-12 12:24:42 · 2156 阅读 · 2 评论 -
PAT天梯赛练习题——L3-007. 天梯地图(多边权SPFA)
L3-007. 天梯地图时间限制300 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越本题要求你实现一个天梯赛专属在线地图,队员输入自己学校所在地和赛场地点后,该地图应该推荐两条路线:一条是最快到达路线;一条是最短原创 2016-06-21 11:03:46 · 1870 阅读 · 0 评论 -
Codeforces Round #360 (Div. 2)——C. NP-Hard Problem(BFS染色判二分图)
C. NP-Hard Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently, Pari and Arya did some researc原创 2016-07-07 20:15:58 · 595 阅读 · 0 评论 -
HDU——1874畅通工程续(邻接矩阵弗洛伊德)
畅通工程续Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 41849 Accepted Submission(s): 15463Problem Description某省自从实行了很多年的畅通工程计划后,终于修建了很多原创 2016-05-12 16:44:32 · 517 阅读 · 0 评论 -
ACM程序设计选修课——1081: 堆(BFS)
1081: 堆Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 26 Solved: 9DescriptionInputOutputSample Input3110310 5 31 21 351 2 3 4 53 1原创 2016-06-18 11:34:35 · 473 阅读 · 0 评论 -
POJ 1419 Graph Coloring(最大独立集/补图的最大团)
Graph ColoringTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4893 Accepted: 2271 Special JudgeDescriptionYou are to write a program that tries to原创 2016-08-06 14:59:55 · 640 阅读 · 0 评论 -
暑假训练round 3 题解
今天做题运气出奇的好,除了几处小错误调试之后忘记改掉了……最后还AK了……虽然题目不难,学长也说是福利局,但是对个人的鼓励作用还是挺大的……至此暑假训练就结束了,也算没有遗憾……。题解如下:Problem A: 苦逼的MCATime Limits: 1000 MS Memory Limits: 65536 KB64-bit interger IO f原创 2016-07-31 21:41:30 · 624 阅读 · 0 评论 -
POJ 3255 Roadblocks(A*求次短路)
RoadblocksTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 12167 Accepted: 4300DescriptionBessie has moved to a small farm and sometimes enjoys returni原创 2016-08-09 13:11:20 · 623 阅读 · 0 评论 -
HDU 5521 Meeting(虚拟节点+最短路)
MeetingTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1358 Accepted Submission(s): 435Problem DescriptionBessie and her f原创 2016-07-24 17:57:52 · 572 阅读 · 0 评论 -
HDU——2112HDU Today(SPFA+简单Hash或map+前向星)
HDU TodayTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23854 Accepted Submission(s): 5743Problem Description经过锦囊相助,海东集团终于度原创 2016-06-17 17:08:27 · 646 阅读 · 0 评论 -
POJ——1364King(差分约束SPFA判负环+前向星)
KingTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11946 Accepted: 4365DescriptionOnce, in one kingdom, there was a queen and that queen was expecting a原创 2016-06-16 14:04:56 · 936 阅读 · 0 评论 -
HDU——2066一个人的旅行(优先队列SPFA水题)
一个人的旅行Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 29929 Accepted Submission(s): 10280Problem Description虽然草儿是个路痴(就是在杭电待了一原创 2016-05-25 15:55:15 · 588 阅读 · 0 评论 -
HDU——1233还是畅通工程(克鲁斯卡尔+优先队列)
还是畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 38031 Accepted Submission(s): 17161Problem Description某省调查乡村交通状况,得到的统计表原创 2016-05-20 19:19:11 · 435 阅读 · 0 评论 -
ACM程序设计选修课——Problem E:(ds:图)公路村村通(Prim)
问题 E: (ds:图)公路村村通时间限制: 1 Sec 内存限制: 128 MB提交: 9 解决: 5题目描述现有村落间道路的统计数据表中,列出了有可能建设成标准公路的若干条道路的成本,求使每个村落都有公路连通所需要的最低成本。输入第一行为整数T,表示有T个case(测试实例)。接下来每个case包含:输入数据包括城镇数原创 2016-05-27 19:16:45 · 1179 阅读 · 0 评论 -
ACM程序设计选修课——Problem E:(ds:图)公路村村通(优先队列或sort+克鲁斯卡尔+并查集优化)
畅通工程Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24323 Accepted Submission(s): 10621Problem Description省政府“畅通工程”的目标是使全省任何两原创 2016-05-19 21:44:13 · 872 阅读 · 0 评论 -
HDU——1596find the safest road(邻接矩阵+优先队列SPFA)
find the safest roadTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10813 Accepted Submission(s): 3828Problem DescriptionXX星原创 2016-06-02 18:50:53 · 503 阅读 · 2 评论 -
HUST——1103Party(拓扑排序+个人见解)
1103: PartyTime Limit: 2 Sec Memory Limit: 64 MBSubmit: 11 Solved: 7DescriptionN students were invited to attend a party, every student has some friends, only if someone’s all frie原创 2016-05-19 00:22:47 · 555 阅读 · 0 评论 -
POJ——1308Is It A Tree?(模拟拓扑排序判断有向图是否为树)
Is It A Tree?Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 28399 Accepted: 9684DescriptionA tree is a well-known data structure that is either empty原创 2016-05-22 17:31:59 · 606 阅读 · 0 评论 -
HDU——1272小希的迷宫(并查集+拓扑排序)
小希的迷宫Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 41183 Accepted Submission(s): 12691Problem Description上次Gardon的迷宫城堡小希玩了很原创 2016-05-22 22:02:34 · 470 阅读 · 0 评论 -
NBOJv2——Problem 1037: Wormhole(map邻接表+优先队列SPFA)
Problem 1037: WormholeTime Limits: 5000 MS Memory Limits: 200000 KB64-bit interger IO format: %lld Java class name: MainSubmitDiscussStatisticReturnDe原创 2016-06-03 00:40:21 · 647 阅读 · 0 评论 -
HDU——1874畅通工程续(Dijkstra与SPFA)
畅通工程续Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 42616 Accepted Submission(s): 15785Problem Description某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多原创 2016-05-11 21:56:18 · 444 阅读 · 0 评论 -
POJ——2449Remmarguts' Date(A*+SPFA)
Remmarguts' DateTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 26504 Accepted: 7203Description"Good man never makes girls wait or breaks an appointme原创 2016-07-11 11:12:02 · 519 阅读 · 0 评论 -
POJ——3159Candies(差分约束SPFA+前向星+各种优化)
CandiesTime Limit: 1500MS Memory Limit: 131072KTotal Submissions: 28071 Accepted: 7751DescriptionDuring the kindergarten days, flymouse was the monitor of his原创 2016-06-14 14:16:18 · 596 阅读 · 0 评论 -
PAT (Advanced Level) Practise 1003 Emergency(SPFA+DFS)
1003. Emergency (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAs an emergency rescue team leader of a city, yo原创 2016-08-16 11:13:50 · 655 阅读 · 0 评论