10832 - Yoyodyne

Moderator: Board moderators

Andrey
New poster
Posts: 16
Joined: Sat Mar 05, 2005 8:25 pm
Location: Ukraine,Vinnitsa

10832 - Yoyodyne

mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:
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.

Andrey
New poster
Posts: 16
Joined: Sat Mar 05, 2005 8:25 pm
Location: Ukraine,Vinnitsa
I test my code on this tests!
I can't find mistake!!!

Can anybody help me??
Last edited by Andrey on Wed Mar 23, 2005 4:16 pm, edited 1 time in total.
Sorry for my English!!

mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:
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.

Andrey
New poster
Posts: 16
Joined: Sat Mar 05, 2005 8:25 pm
Location: Ukraine,Vinnitsa

!

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!!

Thank you!!!
Sorry for my English!!

txandi
New poster
Posts: 25
Joined: Sun Feb 29, 2004 2:06 am
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!

Andrey
New poster
Posts: 16
Joined: Sat Mar 05, 2005 8:25 pm
Location: Ukraine,Vinnitsa
Thank you very much!!

Finally, i got AC!!!!!
Sorry for my English!!