传送门:http://poj.org/problem?id=1860 题意:给出每两种货币之间交换的手续费和汇率,求出从当前货币s开始交换回到s,能否使本金增多. 思路:bellman-Ford模板题.直接跑一遍,判断是否存在正环就好了.(复杂度n*m) 代码: #include<iostream> using namespace std; int n; //货币种数 int m; //兑换点数量 int s; //持有第s种货币 double v; //持有的s货币的本金 double di…
POJ 1860 Currency Exchange / ZOJ 1544 Currency Exchange (最短路径相关,spfa求环) 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 onl…
原题链接:http://poj.org/problem?id=1860 Currency Exchange Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 23055 Accepted: 8328 Description Several currency exchange points are working in our city. Let us suppose that each point specializes…
Currency Exchange Time Limit : 2000/1000ms (Java/Other) Memory Limit : 60000/30000K (Java/Other) Total Submission(s) : 4 Accepted Submission(s) : 2 Problem Description Several currency exchange points are working in our city. Let us suppose that…
Currency Exchange Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1860 Appoint description: System Crawler (2015-05-14) Description Several currency exchange points are working in our city. Le…
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…