Блог пользователя AlimA

Автор AlimA, 12 лет назад, По-английски

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?

  • Проголосовать: нравится
  • -5
  • Проголосовать: не нравится

»
12 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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