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

Автор I_AM_SHY, история, 10 лет назад, По-английски

Hi everyone, I was solving problem http://codeforces.me/problemset/problem/276/D. I understood that there are two ways to get the answer. I am interested in understanding the dynamic programming solution mentioned in the tutorial here: http://codeforces.me/blog/entry/6779 I am unable to understand the authors explanation. I even tried working through the code but i could not understand the solution. Could somebody please explain the DP solution? What is the state? What are the transitions and how do they work? Why does the author add (1<<s1.size()-p-1) instead of (1<<p)? Your help will be highly appreciated.

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

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

Because he run from the highest to 0 but it's position in string representation is from 0 to it's size.