ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1162. Currency Exchange

Any hint? How to solve it with shortest path?
Posted by Maigo Akisame (maigoakisame@yahoo.com.cn) 24 Oct 2004 06:12
Re: Any hint? How to solve it with shortest path?
Posted by HybridTheory 24 Oct 2004 19:28
Bellman-Ford.
Do Bellman-Ford once to find the longest path.
If there is a positive cycle then Yes,otherwise No.
Please in 1217 help I need answer N=12, 14, 16. help I am in contest
Posted by BSP 24 Oct 2004 19:33
I am in contest know please help I must solve this problem
1217. N = 12, 14, 16.
Re: Please in 1217 help I need answer N=12, 14, 16. help I am in contest
Posted by Maigo Akisame (maigoakisame@yahoo.com.cn) 25 Oct 2004 10:33
12--3052783504
14--266095289560
16--23194144960900
GL!
What's the length of edges?
Posted by Maigo Akisame (maigoakisame@yahoo.com.cn) 25 Oct 2004 10:33
I get WA #13, could you help me?
Posted by Maigo Akisame (maigoakisame@yahoo.com.cn) 25 Oct 2004 15:45
[code deleted]

Edited by moderator 23.06.2006 17:15
Here's what's wrong in your algorithm (+)
Posted by Michael Rybak (accepted@ukr.net) 26 Oct 2004 20:36
this is wrong:

...
else begin
writeln('YES');
halt;
end;

It isn't necessarily a YES. You can't be sure that there's positive cycle by only condition that you've found 2 different positive values for money[b]. Your code can be easily modified (took me 1 min) though in such a way that you get AC, checking the condition of 'YES' answer correctly. I can write you an email, telling how to do that, if you want.
I've written a new prog, but it's WA 19. Can you help?
Posted by Maigo Akisame (maigoakisame@yahoo.com.cn) 31 Oct 2004 10:20
[code deleted]

Edited by moderator 23.06.2006 17:15
Ah, it's really easy to get AC. It's YES only if i=n.
Excuse me, why it's YES only if i=n ???
Posted by ferng1021 23 Jun 2006 14:12
another question :

"pre[b]:=pre[a]+pre[b]+[a];"

May I use "pre[b]:=pre[a]+[a]" ??