thefatperson's blog

By thefatperson, history, 4 years ago, In English

Even after reading the editorial and doing the dp by hand, I still don't quite understand what the DP is on. Can someone please help explain? Analysis: Editorial Problem: Statement

  • Vote: I like it
  • -1
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

After each game, Bessie can either continue playing the previous choice she used, or she can change it up. We know the maximum number of times that Bessie will switch, which is K = 20 times From this we can determine the dp state where dp[i][j[k] represents the maximum games that Bessie can win, in the first i games, if she has switched choices at exactly j times, where the last choice she played was k.

For example dp[11][5][2] may correspond to the value where you played 11 games, switched your choice 5 times, and your current hand is 2 which may represent scissors, idk.

Hope this helps :p