CustomCC0-1.0#ct-p4-032100
Rollback DSU Interval Connectivity
Summary
- •Phase 4 / dsu-rollback
- •Reasoning-first competitive programming drill
Problem Description
Given edge active intervals [l,r], answer connectivity for each time t query. Your submission must justify algorithm choice, prove correctness, and test adversarial edge cases.
How to read this problem in plain language:
- This is a Phase 4 reasoning drill focused on dsu-rollback.
- Typical lenses to test first: dsu, offline, divide-and-conquer.
- Constraints reminder: n,m,q <= 2e5
Mini examples for mental simulation:
1) Boundary example: Intervals of length 1. Explain expected behavior and why naive logic may fail.
2) Adversarial example: Queries always false. Explain expected behavior and why naive logic may fail.
Lite-mode writing target:
- Write 1~2 observations that shrink the search space.
- Name one final algorithm and state target complexity explicitly.
- Validate with at least 2 edge cases and one hand simulation.
Constraints
- •n,m,q <= 2e5
Analysis
Key Insight
Use union by size only for reversible state. This step should reduce search space or formalize correctness. State why this insight changes your algorithm choice.
dsuofflinedivide-and-conquer