Built on
segment tree
Articles
GRA
Algorithm
Heavy paths
Path queries on trees: heavy paths cut any path into O(log n) array stretches under a segment tree.
O(log² n) per query
1 problem
DP
Technique
Convex hull trick
A minimum of lines instead of a search: 1776 catalogue tests split into sandbox runs, and a quadratic DP becomes linear.
O(n)
2 problems
Problems
Often together
contests 2 tree 1 range queries 1 graph 1 geodata 1 science and physics 1 dynamic programming 1 optimization 1 scheduling 1 two pointers 1