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}}1−2×Cn3∑i=1n(n−1−bi)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