76 exam simulation summary

Before successive explosions, thought too much

20 minutes before reading the question: T1 look no idea, violence dp a good fight, T2 that have no idea, only 20 minutes n == 3 index enumeration, T3 watching preamble preorder, and no ideas the

T1 first sought to continue the exchange to meet the meaning of the questions, then hit the table, found a fake law, continue to get to the bottom to see it come out, wrote a total of two hours, too slow, mainly thought as positive solution side to part points, while zzyy Gangster only 30 minutes

There 1h20min, T2, T3 alternately thinking nothing thinking out,

T2 open large sample, did not discover the nature of the sort output, pay attention to start from issued a document, if it is not random data, it is likely to have the law

T3 catalan 20 points ,,, examination of the third, the third did not see it. Then associated with the catalan only a pull stack order not test too?

 

T1 "nature of the problem."

Found that the playing table (lexicographically smallest) configured by: a reverse cnt eventually interval, the number of the discharge head of the queue las ascending, descending finally meet length + inter-las <b section (0/1) + cnt number of cells constituting the reverse

Such as: = n-10, A =. 5, B =. 3: . 1 2 . 4. 3   . 7. 6. 5   10. 8. 9 

 

T2 "nature of the problem."

According to a large sample can be obtained:

A first small to large, then when the current a_i / 2> sum_ {i-1}, then [sum_ {i-1}, a_i] interval can not be covered

prove:

For a sum, will [sum / 2.sum] numbers have become a wonderful number

Consider small to large to join each item:

Then one interval [sum / 2, sum],

Current a_i = sum * 2, then expand to [sum * 3 / 2,3sum], will cover only selected a_i [sum, 2 * sum]

That is, to ensure that there is no gap,

When a_i more, i.e., a void will obviously [sum_i + 1, a_i / 2], regardless of the former i-1 is selected from the sum total of one row or not a_i

 

T3「DP」

Definition of F [i] [j] is in a subtree rooted at i is the size of the number of program j

Restrictions can be found in only two cases,

Preamble for a <b, and

If the request after a sequence b, then b only a left subtree, since the numbers in a row, then the left subtree size necessarily> = satisfies all the conditions change max {ba}

If a before b, then b is not in a left subtree, possible right subtree, lca also be on the other side, then the left subtree size necessarily <min {ba}

Pretreatment out of all restrictions

And O (n ^ 3) sequentially enumerated node number i, the size of subtree j, k, and the size of the left subtree

$$f[i][j]=\sum f[i+1][k]* f[i+k+1][j-k-1]$$

Note that f [i] [1] 1 can not be initialized, because there may be no subtree size is 1

 

Guess you like

Origin www.cnblogs.com/casun547/p/11691213.html