7.12
HDU 5280 Senior ' s Array
A DP method that complements an O (n).
Dp1[i] for I left end max continuous and. Dp2[i] for I right end maximum continuous and.
Enumerates where the p is changed.
If P is in the maximum range and medium. Then ans is the maximum continuous and p for p.
If P is not in the maximum range and in. Then ans for all the largest continuous and medium largest.
Note When the interval takes the entire array. P is bound to be included.
That is, the second case cannot take the entire array.
Aguin
7.13
It is true that nothing has been done in the end.
7.14
One last BC.
HDU 5282 Senior ' s String
I was supposed to make up yesterday. After all, the high-generation exams finished ≈ holiday.
However, the mill does not understand the state transfer equation.
Read the official puzzle again today. And looked at other people's code. It's almost understood.
A DP array is an LCS request.
F[I][J] Indicates how many sub-sequences of length dp[i][j] appear in the first J characters of y in the first I character of the X-string.
Note the case of the empty string. So f initialization is dp[i][j]==0 when f[i][j]=1. The remainder is 0.
The transfer is divided into two cases.
i) X[i] does not belong to a child column of length dp[i][j]. This happens only when Dp[i][j]==dp[i-1][j] is available. So F[i][j]+=f[i−1][j].
II) X[i] is a sub-column of length dp[i][j]. This is where you first find the last and X[i] characters in Y. The location is identified as P.
Because X[i] ends with a length of dp[i][j], the number of child columns equals the number of child columns in front of the last pair of matched characters and with a length of dp[i][j]-1.
That satisfies dp[i−1][p−1]+1==dp[i][j]. Have f[i][j]+=f[i−1][p−1].
Aguin
You can first write all p with an array first. And yet not fast.
7.15
Back English.
7.16
The mood is bad after the exam. Complement BC.
The mystery of the RE. We will adjust tomorrow.
7.17
HDU 5283 Senior ' s Fish
I found myself stupid and dead.
#define MAXN 100000+10
Then the segment tree is case tree[maxn*4].
。。。。。。。。。。。。。。。。
It was a review of the line tree and Lazytag. Complete a set of BC for the first time.
Aguin
7.18
Hit a BC. A few computational guests. Pending repair.
"Aguin" Nineth Week 7.12-7.18