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

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

I recently read the article from PEG Wiki about the convex hull trick, which can be applied to speed up dynamic programming algorithms (Link to the website) . This optimisation can only apply when certain conditions are met. Surprisingly, at the end of the article I read that we can achieve a fully dynamic variant of the trick (meaning that there are no conditions of applicability) if we store the lines in a std::set. Although I have understood the approach mentioned, I always fail when I try to implement it. Could someone point me to an implementation of the dynamic convex hull trick, and some problems where I can practice it? Thanks in advance.

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

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

Here are many good convex-hull trick problems (also in the comments): http://mirror.codeforces.com/blog/entry/8219

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

Here is my alternative implementation. Hope this will help somebody. Note: this class can be used to find both max and min values.