NOIP2015 raising the group Day2 sub-string

Source: Internet
Author: User
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+

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.