Page 1 of 1

10832 - Yoyodyne

Posted: Wed Mar 23, 2005 9:28 am
by Andrey
Please HELP!!!! :oops: :oops:

Posted: Wed Mar 23, 2005 11:04 am
by mf
Here are some inputs and output from my accepted program.

Code: Select all

2 1 1 3
0 0 1
0 0 10
0 0 5

10 1 1 1
0 0 101

4 1 1 1
101 101 101

7 2 3 1
555 555 555

7 2 3 1
123 456 789

55 2 11 2
12 34 56
55 55 55

0 0 0 0
Output:

Code: Select all

Mission 1: FAILURE!! Traveled: 2.00  From Home: 7.00
Mission 2: FAILURE!! Traveled: 10.00  From Home: 90.00
Mission 3: FAILURE!! Traveled: 4.00  From Home: 170.36
Mission 4: FAILURE!! Traveled: 10.50  From Home: 950.21
Mission 5: FAILURE!! Traveled: 10.50  From Home: 908.20
Mission 6: SUCCESS!! Time: 10.33  Traveled: 113.63  Fuel Left: 34.34
hope it helps.

Posted: Wed Mar 23, 2005 11:45 am
by Andrey
I test my code on this tests!
I can't find mistake!!!

Can anybody help me??

Posted: Wed Mar 23, 2005 11:56 am
by mf
The next buoy to visit is determined by the closest buoy in the mission that has not yet been visited. In case of a tie, the buoy information that comes first in the input is given preference.
Your code always processes points in the order they come.

!

Posted: Wed Mar 23, 2005 4:15 pm
by Andrey
The next buoy to visit is determined by the closest buoy in the mission that has not yet been visited. In case of a tie, the buoy information that comes first in the input is given preference.
I don't understand this sentence, please say this in other words!! :oops:

Thank you!!!

Posted: Wed Mar 23, 2005 4:49 pm
by txandi
The next buoy to visit is determined by the closest buoy in the mission that has not yet been visited. In case of a tie, the buoy information that comes first in the input is given preference.
It means that when you're in a place A, the next place B to visit must be the not already visited one that minimizes dist(A,B). In case of tie, you have to choose the first B that minimizes dist(A,B) that appears in the input.

Hope it helps!

Posted: Wed Mar 23, 2005 7:03 pm
by Andrey
Thank you very much!!

Finally, i got AC!!!!!