Summary of routines for common problems in OI

  1. When encountering interval problems, think more about difference, especially difference on tree
  2. The right of the upper edge of the tree is transferred to the point of the right to the son node, but pay special attention to the processing of redundant information (especially when the tree is sectioned). For
    example , when the tree section is finished, the last heavy chain is processed. Information (topx, fatopx) (top_x,fa_(top_x))(topx,f atopx)
  3. Data structure questions don’t just think about log ⁡ \logLo g structure, isn't it fragrant when divided into blocks? Doesn't it fragrant to divide and conquer it? Doesn't it fragrant for Team Mo?
  4. When you see the graph topic, think about these questions first: Is the graph connected? Directed graph or undirected graph? Is it right? Are there heavy edges and self loops?
  5. Encountered similar to nnDivide n things into two groups and minimize the difference. Don’t always think about some weird algorithms.If it is a capacity of n 2 \dfrac{n}{2}2nWhat about the backpack problem? The volume and value at this time are both this nnThe attributes of n things.
  6. When encountering matrix problems, don't always think about algorithms related to matrices. Sometimes it may just be a simple graph theory. Each point may be a point, or a column and a line may be a point. It is possible.
  7. If there are no special circumstances, try to use the vectordeposit side . If you want to use the chain forward star (such as network flow), see clearly whether it is a directed graph or an undirected graph. The undirected graph space needs to be doubled!

Guess you like

Origin blog.csdn.net/BWzhuzehao/article/details/114667127