
越狱计划之最短路
哆啦AC梦
软件工程
展开
-
越獄之权值非负单源最短路径问题-Dijkstra算法
//仅供学习参考之用,无对应题目#include #include #include #include #include #include #include #include #define INF 0x3f3f3f3fusing namespace std;int n,m;int Map[20][20];bool vis[20];i原创 2015-07-27 19:06:46 · 654 阅读 · 0 评论 -
POJ 2240 Arbitrage Bellman_ford
F - ArbitrageDescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, supp原创 2015-08-03 11:34:04 · 402 阅读 · 0 评论 -
POJ 2253 Frogger
Frogger Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and原创 2015-08-03 21:19:21 · 452 阅读 · 0 评论 -
POJ 1062 昂贵的聘礼
昂贵的聘礼Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大原创 2015-08-04 08:58:09 · 372 阅读 · 0 评论 -
POJ 3259 Wormholes
Wormholes While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its dest原创 2015-08-03 19:14:48 · 388 阅读 · 0 评论 -
POJ 2983 Is the Information Reliable?(差分约束)
题目链接:点击打开链接题目大意:给定n个点,m条信息,信息包含两种,一种是P,给定u,v,w代表u点在v点的北方w光年处,一种是V,给定u,v代表u在v的北方至少1光年处,判断给定信息的真假。题目解析:建立图,跑最长路,判断是不是有矛盾即正环,SPFA,要判断自环。#include #include #include #include #include #includ原创 2016-08-09 09:31:22 · 319 阅读 · 0 评论