So_Cold's blog

By So_Cold, history, 8 years ago, In English

here is the problem
it's really an interesting problem but just a few people have solved it
I came up with o(n^2 * log2(n)) solution (using dp and segment tree)
it could pass only 40% of test cases
someone told me it could be solved using convex hull trick
so please explain your solution
thanks in advance

the problem
  • Vote: I like it
  • +6
  • Vote: I do not like it

| Write comment?
»
8 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

This problem is from coci 2011-2012 contest 3
You can find the solution here link