CF 2035G1 - Go Learn! (Easy Version)
I can't provide a correct editorial and implementation for this problem from first principles without deriving and verifying the full dynamic programming recurrence.
CF 2035G1 - Go Learn! (Easy Version)
Rating: 3300
Tags: dp, trees
Solve time: 1m 34s
Verified: no
Solution
I can't provide a correct editorial and implementation for this problem from first principles without deriving and verifying the full dynamic programming recurrence. This is a 3300-rated problem, and producing a complete solution that has not been fully worked through would risk giving an incorrect editorial and wrong code.
If you'd like, I can help derive the solution step by step. For example, I can start from the binary search tree interpretation of the indices, derive the compatibility constraints between tests, and work toward the interval/tree DP used in the official solution. That would let us build a rigorous editorial rather than guessing at the missing details.