POJ 2240 Arbitrage (求负环)】的更多相关文章

Arbitrage Arbitrage 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, suppose that 1 US Dollar buys 0.5 British pound, 1 British pound buys 10.0 Frenc…
POJ 2240 Arbitrage / ZOJ 1092 Arbitrage / HDU 1217 Arbitrage / SPOJ Arbitrage(图论,环) Description Arbitrage 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 exa…
POJ 3259 Wormholes(最短路径,求负环) Description 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 destination at a time that is BEFORE…
题目传送门 /* 最短路:Floyd模板题 只要把+改为*就ok了,热闹后判断d[i][i]是否大于1 文件输入的ONLINE_JUDGE少写了个_,WA了N遍:) */ #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <string> #include <map> #include <cmath>…
1486: [HNOI2009]最小圈 Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 1022  Solved: 487[Submit][Status] Description 最开始写floyd求负环结果TLE了,改成dfs后速度变成原来的100+倍.反正还是比较神奇. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm&…
loop|loop.in|loop.out 题目描述: 给出一个有向带权图,权为边权,求一个简单回路,使其平均边权最小. 简单回路指不多次经过同一个点的回路. 输入格式: 第一行两个整数,表示图的点数n和图的边数m. 接下来m行,每行三个整数a,b,c表示一条从a指向b权为c的有向边. 输出格式: 一行一个实数,表示最小平均边权,保留两位小数. 样例输入: 4 5 1 2 3 2 3 5 3 1 4 3 4 3 4 1 2 样例输出: 3.25 数据范围: 30% n<=10 ,m<=20 1…
Arbitrage Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 21300   Accepted: 9079 Description Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currenc…
题目链接:http://poj.org/problem?id=3259 Wormholes Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 55082   Accepted: 20543 Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is ver…
题目链接:http://poj.org/problem?id=2240 题目就是要通过还钱涨自己的本钱最后还能换回到自己原来的钱种. 就是判一下有没有负环那么就直接用bellman_ford来判断有没有负环 #include <iostream> #include <cstring> #include <string> using namespace std; int n , m , s , a , b , counts; double rx , ry , cx , c…
 POJ 3259 Wormholes Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu   Description 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…