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

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

problem link: here

I've tried the brute force approach, but TLE for sure :P

Any hints will be appreciated!

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

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

It's DP problem. D(L, R).

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

what is the secret behind the negative votes, it's just a question! what does it mean? is the answer is "the question is too easy to answer it ?!" your negative vote has no mean. just makes the weak students frighten from asking again!

»
12 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

I solve this problem with a dp aprouch : the main idea is that we can define a poligon with two indexes lo , hi lo <= hi that means that we have a convex polygon from lo , lo + 1 , .. hi , lo (the last edge close the polygon) the we can cut between some pair of point of our current polygon (in this transicions we have to conserve that the two halfes of polygon (subproblems) have 2 * n points (n >= 2) )

Finaly we have a O(n^4) complexity.

UPD : Code