Heavy-Light Decomposition Template for Tree Path Queries

The following C++ implementation demonstrates a complete Heavy-Light Decomposition (HLD) framework integrated with a lazy propagation segment tree to support efficient path updates and queries on trees. It passes the standard template problem on Luogu. #include <bits/stdc++.h> using namespace std; using i64 = long long; int MOD; struct ...

Posted on Mon, 18 May 2026 00:02:42 +0000 by swizzer

CSP 2025 Simulation Problems - Technical Analysis and Solutions

Problem Set Overview This document presents detailed solutions for four computational problems from a recent programming contest simulation. Each problem requires distinct algorithmic approaches, ranging from greedy selection with block decomposition to probabilistic expectation calculations on bounded domains. The solutions presented have been ...

Posted on Sat, 16 May 2026 11:29:24 +0000 by missdeath