noip2018 practice summary

Foreword

From eight in the morning written to 5pm wrote D1 and D2T1, and I feel about the same efficiency exam last year
I know this is a solution to do ah! ! ! ! ! , I will feel fiasco. . . .


Day1

T1

Like a long time, or only barely card last n ^ 2, obviously listening to other people talked about positive solutions
directly greedy, read a a [i], if a [i]> a [i -1] put the answers together a [i] -a [i- 1], otherwise it is not operating, clearly demonstrated

code


T2

T2 now feel quite easy, and how to consider a currency helpful
if and only if it can not be less than its currency, by considering similar thinking group can be a linear
and a row order, like a backpack run completely. . . .

code


T3

T3 wrote most of the morning,
to see Min Max thought of it first-half,
consider dp or greedy, I want to stare the dp
set dp [x] [i] [ j] to x is the root of the sub-trees, i Article legitimate, hang on the chain length of the longest root j is
then transferred very strange feeling, like greedy selected i like the biggest, then it greedy
for each sub-tree to safeguard the legitimate chain within the maximum number of sub-tree, and hung on the chain length of the longest root
and sub-section similar to FIG chrysanthemums do it, with a multiset

ps: set to use the set comes with lower_bound, or will fly the T, because this tune for a long time

code


Day2

T1

Will nlogn last year, today will not be, and
feel good chaos of thinking, a lot of things more complicated want
to see n ^ 2 may be over, so direct enumeration which edge off, and then like a tree, like greedy on it

code


Guess you like

Origin www.cnblogs.com/lzqlalala/p/11768515.html