2021.07.12 [NOIP improves Group B] Simulation summary

Good elements

Naked Hash (I am a paratrooper , I can do this wrong)

The general idea of ​​the topic

If there exists Am + An + Ap = Ai (1 <= m, n, p < i) (m, n, p can be the same), Ai is a "good element"

Um? That's it? ? How many "good elements" are there? ? ?

answer

Move an item Am + An = Ai -
The hash on the left side of Ap is stored, and the n 2 enumeration
hash on the right side is the single hash I typed during the exam, RTE?
Make it a little bigger, TLE? ?
Change to double hashing, WA? ? ?
Change mod, AC! ! !

shortest path

I never thought about DP, wu...

The general idea of ​​the topic

Select several points from n points (must select b 1 b1b 1 , cannot chooseb 2 b2b 2 ), from 0 ~ n -1 in order, and then use other points from n-1 ~ 0 to find the shortest path.

answer

The DP
conversion question means that two people walking cannot walk to the same point.
Let f [ i ] [ j ] f[i][j]f [ i ] [ j ] is the first person in i and the second person in j.
Letk = max ( i , j ) k=max(i,j)k=max(i,j ) , then it must also be satisfied that 1~k have all been passed.
Thenf [ i ] [ j ] f[i][j]f [ i ] [ j ] can be transferred tof[k+1][j]f[k+1][j]f[k+1 ] [ j ] andf[i][k+1]f[i][k+1]f[i][k+1 ]
Special judgmentk = = nk==nk==n andb 1 b1b1 b 2 b2 b 2 case l,.

longest common substring

Double pointer.

Vani and Cl2 hide and seek

The longest anti-strand length of DAG.

Guess you like

Origin blog.csdn.net/zhy_Learn/article/details/118684567