East Division High School B team sprint NOIP2019 knowledge layer simulation (3) solution to a problem Edition

I heard often send explanations rp ++

Portal

T1

Monotonous stack

Or a bare title

Really tiger

Code

T1

T2

Data interpretation is that this question practice

Invite only 1

In all circles to find 1 of

Get rid of it

If there is only one circle, and then continue from where it began to look for

It is a wide search

Code

T2

T3

Is a list

Keep what is now the state where change is coming

If 'a', is changed from i-1 to the

If 's', it is the precursor to the i-1 variant of

If 't', is changed from k-1 to the

Code is repeated like a cross jump

Code

T3

T4

BFS/DFS

Code

T4

T5

The MST (minimum spanning tree)

And who do not check who set tiger

Code

T5

T6

Obviously the DP

Provided dp [i] [j] denotes the step i, j times the maximum run

With a [i] in order to record the drop

For example the sample may be converted to 1222

It is the first one out, and then two off on another tree, then another tree fell on two, and then two off on another tree. It is ctrl_c + ctrl_v

那么,dp[i][j]=max(dp[i][j-1],max(dp[i-2][j],dp[i-1][j-1])+a[i])

Code

T6

T7

Extremely Obviously, if a three times in front of other b, then the column number of the original prior to a certain b

So with a map record what rank, and then look like a sort

Code

T7

Guess you like

Origin www.cnblogs.com/yanghaokun/p/10959985.html