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

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

Edited by moderator 23.06.2006 17:15
Michael Rybak (accepted@ukr.net) Here's what's wrong in your algorithm (+) [3] // Problem 1162. Currency Exchange 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.
Maigo Akisame (maigoakisame@yahoo.com.cn) I've written a new prog, but it's WA 19. Can you help? [2] // Problem 1162. Currency Exchange 31 Oct 2004 10:20
[code deleted]

Edited by moderator 23.06.2006 17:15
Maigo Akisame (maigoakisame@yahoo.com.cn) Ah, it's really easy to get AC. It's YES only if i=n. [1] // Problem 1162. Currency Exchange 1 Nov 2004 13:13
another question :

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

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