2020.10.17【Popular Group】Summary of Simulation Group C

T1: Little x's Arbor Day

A reverse thinking problem in mathematics.
Let’s think backwards and find out how many illegal ones. The formula is:
1 − ∑ i = 1 n (n − 1 − bi) bi 2 × C n 3 1-\frac{\sum_{i=1}^ {n}(n-1-b_i) b_i}{2\times C_{n}^{3}}12×Cn3i=1n(n1bi)bi
PS: (ni-bi)bi is how many items are illegal, and the denominator 2 is to remove the duplicates above.
Score: 100 points

T2: Little x buys New Year goods

A three-dimensional DP that exploded during the exam, did not enumerate backwards, and flew 90.
Score: 10 points
PS: AC

T3: Ten drops of water for small x

Violent simulation, you don't need to search, modify it from time to time, mark it when the water drop is gone, and just add a new water drop.
Score: 100 points

T4 : wtaxi

I used a 01 backpack (yes, it's a double loop). First of all, let's make it clear that, except for the last one, every car is either not sitting or full.
Then, DP is like a backpack, but when enumerating j, it cannot be forwarded, but reversed. Just pay attention to the output of "impossible".
Score: 0 points
PS: Already AC
AK

Guess you like

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