CSP2019 problem solution

According to the order of topics to write CSP

Gray code

The answer can recursively find difficult to find, then you can do every time.

Code

Brackets tree

Simple question, directly engage in a stack and then back to the tree.

Brackets tree nmsl

Code

Number of trees

Gugu Gu

Emiya family meal today

It is evident that this problem may be the inclusion-exclusion, then you can write a \ (O (mn ^ 3) \) The \ (dp \) .

Then consider that the two-dimensional state can make a difference later, this way it became optimization \ (O (2mn ^ 2) \) , then you can before.

Code

Divide

\ (\ texttt {__ int128} \) is not yet incense

Code

The center of gravity of the tree

Code

Guess you like

Origin www.cnblogs.com/fexuile/p/11964351.html