Page 2 of 2

Re: 436 - Arbitrage - Clarify please

Posted: Tue Oct 06, 2009 4:44 am
by subzero
hi guys,

I'm trying to solve this problem using floyd's algorithm, I have read several posts about this problem (436) but I don't get the ac...:S
here it is:

I have tried changing float to double
and the limit in the condition if ( w >1.0 ) to 1.0001, 1.000001, 1.0000001


Code: Select all

DELETED after AC
any idea, thanks

Re: 436 - Arbitrage (II)

Posted: Fri Feb 20, 2015 3:55 am
by fsps60312
Though getting AC, I came up with a testcase:

Code: Select all

2
a
b
2
a -2 b
b -2 a
My AC output gives No.
But I think the answer should be Yes.
Because:a(1)->b(-2)->a(4), then you'll have four times more than origin.
Can anyone explain?

Re: 436 - Arbitrage (II)

Posted: Sat Feb 21, 2015 1:14 am
by brianfry713
There are no negative exchange rates in the judge's input, and that doesn't make any sense.