Data structure • Tree-chain split +LCT

Source: Internet
Author: User

So two of them got together ...

How to say, write is P party style C + +, short also not short to where to go, run up also unpleasant, constant big become dog OTL

Bzoj 1036 Tree Chain classic problem bar, point modification + Road after inquiry

"Code"

Bzoj 2243 Path modification + path inquiry

"Code"

Bzoj 3083 Path modification + subtree inquiry (root variable), the problem is to use a tree chain to find the value of a certain interval in the DFS sequence (Dfs sequence can be looked up subtree, the link can modify the path, the combination of the line)

"Code"

Bzoj 2049 using LCT to maintain forest morphology

"Code"

Bzoj 2631 Path Modification + path Inquiry + morphological variable

This problem is just beginning to use an array to write, and then run well slow ... Then I wrote the LCT of the pointer version, found that running slower, even AC is not qaq

It's too weak, Qaq.

Array Version "code" pointer write residual version "code"

Bzoj 2002 is also a mere maintenance of the tree form on the line. This problem can also be written static block linked list, the result LCT run even faster ...

"Code"

Data structure • Tree-chain split +LCT

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.