saisurya027's blog

By saisurya027, history, 7 years ago, In English

Can someone help me to solve this 346B - Lucky Common Subsequence

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it +4 Vote: I do not like it

Why don't you read the editorial http://codeforces.net/blog/entry/8903

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

    I read it but I didn't understand the logic behind it.So thought someone would explain it in simple way.

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

      dp[i][j][k] : max { length(s) : s is LCS of s1[0,i[ and s2[0,j[, suffix of s and virus share k chars }.

      use KMP to do the state transition.