AlimA's blog

By AlimA, 13 years ago, In English

Hi all :)

For this problem, I used ternary search to find the best point on the west for each point on the east. The best point a[j] for a specific point b[i], is the point which makes the shortest path between the villages and goes from b[i]. Then, the minimum among these numbers, is the answer. Using ternary search is appropriate because the distance between the villages using the specific point b[i] and the points on the left, make an unimodal function.

But, My code for probelem "Building Bridge" has got RE.

I couldn't understand where the problem is. This is my code. Can anyone help me?

  • Vote: I like it
  • -5
  • Vote: I do not like it

»
13 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

The test your program fails is rather small so you can simply launch it on your PC to see what's going wrong.