XYZZY Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4421    Accepted Submission(s): 1252 Problem Description It has recently been discovered how to run open-source software on the Y-Crate gami…
题目链接:http://poj.org/problem?id=3621 Sightseeing Cows Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11526   Accepted: 3930 Description Farmer John has decided to reward his cows for their hard work by taking them on a tour of the big ci…
Currency Exchange Time Limit:1000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1860 Description Several currency exchange points are working in our city. Let us suppose that each point specializes in two par…
d[i]代表从起点出发可以获得最多的钱数,松弛是d[v]=r*d[u],求最长路,看有没有正环 然后这题输入有毒,千万别用cin 因为是大输入,组数比较多,然后找字符串用strcmp就好,千万不要用map 这题刚开始我T了(用的map),还以为组数很多卡spfa呢,然后我上网看了看都是floyd的,然后我用floyd写了一发,891ms过了 然后我感觉spfa的复杂度也不是很大,就是看有没有正环,所以我觉得可能是map+cin的锅,然后改了一发,用的spfa,47ms过 真是,算了,实质是本蒟蒻…
题目连接:http://poj.org/problem?id=1860 题意:有多种从a到b的汇率,在你汇钱的过程中还需要支付手续费,那么你所得的钱是 money=(nowmoney-手续费)*rate,现在问你有v钱,从s开始出发交换钱能不能赚钱. 分析:如何存在正环,能无限增加钱,肯定可以赚了,因此用spfa判一下即可 #include <cstdio> #include <cstring> #include <string> #include <cmath&…
题目链接:http://poj.org/problem?id=1860 Currency Exchange Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 32128   Accepted: 12228 Description Several currency exchange points are working in our city. Let us suppose that each point specialize…
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=25957 思路:由于路线为一个环,将路径上的权值改为c-p*d,那么然后建图,那么我们只需判断图中是否存在权值和为正的环,这个用spfa即可. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<queue&g…
转载来源:優YoU  http://user.qzone.qq.com/289065406/blog/1299337940 提示:关键在于反向利用Bellman-Ford算法 题目大意 有多种汇币,汇币之间可以交换,这需要手续费,当你用100A币交换B币时,A到B的汇率是29.75,手续费是0.39,那么你可以得到(100 - 0.39) * 29.75 = 2963.3975 B币.问s币的金额经过交换最终得到的s币金额数能否增加 货币的交换是可以重复多次的,所以我们需要找出是否存在正权回路,…
Description Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these currencies. There can be several points specializing in the…
Farmer John has decided to reward his cows for their hard work by taking them on a tour of the big city! The cows must decide how best to spend their free time. Fortunately, they have a detailed city map showing the L (2 ≤ L ≤ 1000) major landmarks (…