Skip to main content
📜 WAYPOINT LESSON

Checkpoint — Segment Trees

⭐ beginner⏳ 25 min read📍 Lesson 84 of 281

Pass the graded problem to finish the segment tree module.

Checkpoint — Segment Trees. Pass the graded challenge below to complete the module. It composes everything the module taught: a lazy segment tree whose updates are range ADD (tags accumulate) and whose queries are range MIN (identity −∞). One tree, two different rules — this is the structure you will reuse in every graph/DP optimization later. Watch the identities: add-identity 0 for sums on the way, min identity LLONG_MAX for the query merge... and never let the add-tag rule touch the min-merge rule.

Điểm kiểm tra — Cây phân đoạn. Pass bài chấm bên dưới để hoàn thành module. Đây là phép ghép của cả module: cây lười hóa với cập nhật CỘNG đoạn (tag cộng dồn) và truy vấn MIN đoạn (trung tính −∞). Một cây, hai quy tắc khác nhau — cấu trúc bạn sẽ tái sử dụng trong mọi tối ưu đồ thị/DP sau này. Chú ý phần tử trung tính: cộng → 0, min → −∞/MAX.