Approach
Segment tree or range structure
For Min Plus Convolution Convex Convex, the implementation stores interval information in a range-query data structure so updates and queries avoid rescanning the full input.
- Choose the aggregate stored for each interval or prefix.
- Build or initialize the structure from the input.
- Apply updates and combine the affected nodes to answer each query.
Code notes
- 40 lines of C++ from the credited upstream file yosupo-concave-min-plus-convolution-4.test.cpp.
- The implementation keeps its working state in language-native values and containers.
- 1 loop block detected.
Complexity
Count the build once, then multiply the logarithmic update or query path by the number of operations.
Check the problem constraints before deciding whether this complexity will pass.