sai1's blog

By sai1, history, 3 months 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  

»
3 months ago, # |
  Vote: I like it +4 Vote: I do not like it

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

  • »
    »
    3 months 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.

    • »
      »
      »
      3 months 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.

      • »
        »
        »
        »
        3 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Thanks.got some clarity now.