2021.07.09 [NOIP improves Group B] Simulation summary

Insert image description here

T1: Triangular Array
This is a sign-in question. The rules are directly derived from the exam, which is quite obvious.
Insert image description here

This is a classification discussion. It is equivalent to simplifying the problem to find the distance from a point to one of its vertices. This can be achieved with O(n) recursion, without emphasis.

T2: Compression
This question was not even violent during the exam, resulting in a direct 0.
Correct answer:
It is DP (well, I didn’t think of it during the exam), let f[i,j] be the i-th letter, and now j is The minimum compressed length of loop sections.
The transfer is obviously O(n^2) complexity, but when judging whether it is the same loop as the previous one, HashO(1) is used to judge, which is relatively simple.
After that comes the most annoying step - outputting the answer (I adjusted it all afternoon, and the variable names were repeated, which made me split). It is still easier to implement. Define pre[i,j] to record where f[i,j] has been transferred from. Just fine.

T3: Water Dingdang
I was so greedy that I failed for 2 hours+ in the exam? ? ?
Correct answer: IDA (still fighting)

T4: Hotel
Violent 30 (We are both violent people, why is it 30 when someone is 50)
Correct answer:
Advanced line segment tree (with zuo, you, sum and other parameters added)
is being coded...

Guess you like

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