TRAKA — TRAKA SPOJ

Правка en2, от So_Cold, 2016-08-31 16:32:05

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
Теги convexhull, help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский So_Cold 2016-08-31 16:32:05 5 Tiny change: '^2 * log2(2)) solutio' -> '^2 * log2(n)) solutio'
en1 Английский So_Cold 2016-08-30 10:12:43 1951 Initial revision (published)