Can anyone give the idea to solve this problem?
Is it true that function T(v) has only one local extremum?
10767 - Barcelona's trams
Moderator: Board moderators
-
- New poster
- Posts: 8
- Joined: Sat Dec 20, 2003 12:57 pm
- Location: Duke University, NC
Re: 10767 - Barcelona's trams
I used dynamic programming to find the best velocity for the x-th segment if I arrive with y crashes. When computing this, the corresponding function T(v) (input: speed on the x-th segment, output: expected time to finish the whole track, valid inputs: (0,M-y> ) has only one local minimum and this is also the global minimum you seek.Dmytro Korzhyk wrote:Can anyone give the idea to solve this problem?
Is it true that function T(v) has only one local extremum?
-
- New poster
- Posts: 8
- Joined: Sat Dec 20, 2003 12:57 pm
- Location: Duke University, NC
Re: 10767 - Barcelona's trams
Thanks for your reply.misof wrote:I used dynamic programming to find the best velocity for the x-th segment if I arrive with y crashes. When computing this, the corresponding function T(v) (input: speed on the x-th segment, output: expected time to finish the whole track, valid inputs: (0,M-y> ) has only one local minimum and this is also the global minimum you seek.
I used similar algorithm, but got TLE. What precision should have the value of v to get T with 4 decimal digits?
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
I had this idea in the contest to use dynamic programming. But then I discarded it, because I was not sure about:
To Dmytro:
I think he uses only one value (the value of the local minimum up to this segment, but probably starting with last segment; at least that was what I was thinking about when I tried to solve the problem).
Can this be shown by some induction? Or how did you see that this is also the global minimum?misof wrote:(0,M-y> ) has only one local minimum and this is also the global minimum you seek.
To Dmytro:
I think he uses only one value (the value of the local minimum up to this segment, but probably starting with last segment; at least that was what I was thinking about when I tried to solve the problem).
the function T(v, x, y) which will give the average time velocity for the xth segment with y crashes will depend on the average time for x+1 the segement and y or y+1 crashes. as none of these can be affected by this velocity, they can be assumed to be constant w.r.t this v when you differentiate. so i guess that would be the proof that this method works.
Also, if you work out the function it has only one local minima.
Also, if you work out the function it has only one local minima.
-
- New poster
- Posts: 8
- Joined: Sat Dec 20, 2003 12:57 pm
- Location: Duke University, NC