Here's the book.
The First law: Game analysis is the basis of all practical operations, the opportunity to profit from the main speculative state, the risk of capital is determined by the bottom line of the value of the investment target
The second law: Arbitrage tactics should be background, initiative, interactive, is the safest and most conservative, the most clear, but must not violate the first law
The operation strategy should be the
http://poj.org/problem?id=2240Basic and POJ 1860 the same just put a single point into any point done 1860 and then do this problem completely put the idea on the way overFinish only to find the online solution is Floyd but the whole idea is very similarBut it seems to be too low in efficiency.#include #include#include#include#include#include#includeusing namespacestd;Charstr[ -][ -];Doubleu[ +],v[ +],w[ +];Doubled[ -];intn,m;intFindChar*s) { for(intI=1; i) { if(strcmp (s,str[i]) = =0
Question:
The exchange rate between some currencies is given, and whether a currency can be converted by some columns increases the currency value.
For example, one dollar is more than one dollar after some exchanges. Yes can be output; otherwise no can be output.
Analysis:
First, we need to convert the relationship between currencies into a graph. During conversion, It is very convenient to use the map in STL.
Assign a serial number for each currency. A serial number represents the node in the
The security outsourcing usually refers to the enterprise's information security business through the way of outsourcing completely or partially to the third party service provider to complete, this kind of information security Service Way has
Csto-the world's largest Chinese software outsourcing and project trading platform
Http://www.csto.com
Ten projects outsourcing platform at home and abroad
1. Pig Network
Website: www.zhubajie.com
Features: Domestic projects mainly for page design,
Title Address
The main idea: Give the n kind of money, and M kind of money and money between the conversion value, to find out if there is a kind of money after conversion has become more
How to solve the problem: the shortest path to determine
arbitrage:http://poj.org/problem?id=2240
Effect:
Give you m currency, give you m currency exchange rules, ask whether through these rules can finally make a profit. Eg:1 dollar for 0.5 pounds, 1 pounds for 10 francs, 1 francs for 0.21 dollars, so
Question Link
Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1217
Theme
Exchange various types of coins, and finally switch back to itself if you can earn, then yes, otherwise no
Note that dijsktra should have negative weights. Therefore, the
Bellman asks for the greatest ring. Ask if the currency is in a settlement. For example, if you get 1 yuan, if you get more than 1 yuan after the exchange, there will be a remittance. MAP is more convenient. # Include # include # include
FreuchAlgorithmThat is, the following triple loop.
For (I = 0; I map [J] [k]) map [J] [k] = map [J] [I] * map [I] [k];
Code
# include
# include
# include
using namespace STD; char STR [33] [33], substring [3
It means N currencies and M exchange rates between currencies,Let you determine whether a currency exists after several currency exchangesThe value is greater than the original value, for example, the dollar: dollar = 1: 1;Let you determine whether
Simple Floyd algorithm use, the initial map diagonal on the 1, using the Floyd algorithm after processing only to check whether there is more than 1 on the diagonal, there is a profit (*^__^*).
#include #include int main (void) {int n,t,i,j,k,x,y,
The simple Floyd algorithm is used. In the initial phase, map is set to 1 on the diagonal line. After processing with the floyd algorithm, you only need to check whether there is more than 1 on the diagonal line. If yes, you get (* ^__ ^ *)!
#
http://poj.org/problem?id=2240Test instructions: Now you have n kinds of currency, after the currency is exchanged, eventually still need to be converted into the original currency, if one of the currencies increased, output "Yes", otherwise output "
Question link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1217
The conversion of the currency determines whether the profit is made. If the profit is made, yes is output; otherwise, no is output.
Here we will introduce a map container in STL to
Basically the same as POJ-1860, bellman asks whether there is a ring. Here, we learned other people's code to add the External Loop of the bellman algorithm directly, and then determine whether there is any update or release in this process.
The
/* Be sure to specify whether the first or all uppercase letters are used for output of "yes" and "no". */# include # include double map [35] [35], Hui; char s [35] [150], Nam [150], nam1 [150]; int N, M, F, num = 1, nnum; # define max (a, B) (a)>
Given the exchange rate of various currencies, you can switch between currencies to see if you can use some kind of exchange, which will make you end up with more money than you have just started, and of course the same currency.
If usually do the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.