I_AM_SHY's blog

By I_AM_SHY, history, 10 years ago, In English

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.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
7 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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