Luo Gu $ P4331 \ [BOI2004] \ Sequence $ digital sequence leftist tree

Correct answer: Hidarihen树

Report problem solving:

Portal $ QwQ $

Begin to see when $ jio $ have looked like before doing a $ dp $ ,,,

But the problem is that $ dp $ stringent say here is strict?

Difficult to think we can make $ a_ {i}, b_ {i} $ Subtracting $ i $ so that question becomes hot ,,,? $ QwQ $

But if $ dp $, then the complexity is $ O (n ^ 2) $ on fake $ QwQ $

Introduce a leftist tree approach, the complexity is $ O (nlogn) $ of $ QwQ $ here

$ Dbq $ off work may be a goo

$over$

Guess you like

Origin www.cnblogs.com/lqsukida/p/11324331.html