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 1004. Sightseeing Trip

I have the same problem and I don't know why.
If somebody know this test or some other like that, please show it.
I supose that there is only one test... But all what you need is delete one road between 2 points and with help of Deikstra find out the shortest way between this points ... than add length of road and you find out the shortest way throw this row.... and so on! I solved this problem such way!
Ilya Rasenstein Re: I've got TL#1.Is the Test#1 so difficult? [10] // Problem 1004. Sightseeing Trip 16 Aug 2005 21:45
It's O(N^4)! You can optimize this nice idea to reach O(N^3)!
Cybernetics Team Re: I've got TL#1.Is the Test#1 so difficult? [9] // Problem 1004. Sightseeing Trip 20 Aug 2005 00:44
here is test 1:
4 6
1 2 40
1 3 50
1 40 60
2 3 10
2 4 30
3 4 20

one answer: 2 3 4
Thank you very much!
Валентин (PSU) Re: I've got TL#1.Is the Test#1 so difficult? // Problem 1004. Sightseeing Trip 23 Feb 2006 21:08
Thanks for your test... :)
I have AC 0.046 sec...
obtuseSword Re: here is test 1 // Problem 1004. Sightseeing Trip 3 Jun 2007 16:59
but this problem says:
"...In the town there are N crossing points numbered from 1 to N..."
Cybernetics Team wrote 20 August 2005 00:44
here is test 1:
4 6
1 2 40
1 3 50
1 40 60
2 3 10
2 4 30
3 4 20

one answer: 2 3 4
My program prints:
2 4 3
It's true, imho.
Ibragim Atadjanov Re: I've got TL#1.Is the Test#1 so difficult? // Problem 1004. Sightseeing Trip 7 Mar 2009 02:16
I think It's :
1 2 40
1 3 50
1 4 60
2 3 10
2 4 30
3 4 20
my ans is 2 3 4,but get WA at Test#1
Andreas Mihaloianis Re: I've got TL#1.Is the Test#1 so difficult? // Problem 1004. Sightseeing Trip 17 Mar 2014 04:59
Impossible. I get 2 3 4 as answer at get wrong answer on #1
Floyd Algrathm is also advisable. However, please take note of another test:
4 4
1 2 10
2 3 1
3 4 1
4 1 1
should output things like 1 4 3 2
but NOT 1 4 3 4