Time Division (also known as CDQ) is an algorithm to solve a kind of "contribution independent", "Support offline" data structure problem.
Suppose there is a sequence of operations: Abaabaabbaaab, where each a contributes a certain amount to the B behind it, which requires the output of each B corresponding answer.
"Contribution independence" means: the effect of each A on its subsequent B is not affected by other A, that is, we use all a in front of B to update B, then B's answer is correct.
Examples of contribution independence: Max,min,sum,count (extremum, and the number of a that satisfies a certain condition).
"Support offline" means that each AB must be given at the beginning, some problems (such as maintenance of convex hull optimized DP), maybe A and B are together, that is, affected by the previous things, the answer after the impact of the next thing, this thing can also be done (although at first it did not tell us what the impact of each of the back).
so that we can turn the above problem into: AAAABBBB, so that we can pre-process some information according to all of the previous a, and then go to update the following B (main).
Overall two points: to solve some questions have a dichotomy of the problem, but if a single query to go to two points, then for a query may need to do a preprocessing, time is not allowed.
The whole dichotomy is to share some preprocessing, and then at the same time the two points of all inquiries, the difficulty lies in sharing what information and how to achieve.
Time Division and overall two-part summary