Topic
Analysis
I thought about DP in the exam room, but.
Well, no, but that's the result, it's the consequences of not trying enough.
Okay, back to the chase. Method 0
: (SB method of Examination room ...)
Set F[i,j,k] for a just match to i,b exactly match to J, the scheme number of K-group F[i,j,k] for a just match to the i,b exactly match to J, Divide K Group scheme number
Transfer is very violent: A string enumeration X,b String Enumeration Y, then judge, then accumulate. Method 1: (by Philipsweng)
Set FK,I,J represents the last substring after the last separation of a string [L,r]<=i,b string matches to J, and the scheme number of the K segment fk,i,j represents the last substring after the end of a string [L,r]
Fk,i,j=fk,i−1,j+∑ix=1,a[x. I]=b[j−i+x. j]fk−1,x−1,j−i+x−1 fk,i,j = Fk,i−1,j +\sum_{x=1,a[x. I]=b[j−i+x. j]}^ifk−1,x−1,j−i+x−1
But this is too slow, and we think about optimizing:
We found that each time this was updated, there was no good use of the previously available state.
So, let's analyze fk−1,i,j and Fk,i,j fk-1,i,j and Fk,i,j.
fk,i,j=fk,i−1,j+