NOI Online 2022 Contest Solutions: Monotone Stacks, Set Systems, and Multidimensional Partial Orders

Problem 1: Stack Elimination with Color Constraints Given a sequence where each element possesses a color and value, process multiple queries. For each query $[L, R]$, simulate a monotonic stack traversal from left to right: pop the top while it is less than or equal to the current value or shares the same color. Determine how many positions wi ...

Posted on Tue, 22 Sep 2026 16:39:41 +0000 by ldb358

Solution Set for the 2023 SMU RoboCom-CAIP Selection Contest

Problem A: Maximum Value Boundary Analysis In this problem, we need to calculate the sum of counts $f(k)$ for pairs $(i, j)$ that satisfy specific boundary conditions related to two arrays $A$ and $B$. Let $f(k)$ represent the number of valid pairs where the second index $j$ equals $k$. We define $last\_k$ as the index where the maximum value o ...

Posted on Fri, 04 Sep 2026 16:45:03 +0000 by dhaselho