This repository has been archived on 2022-06-22. You can view files and clone it, but cannot push or open issues or pull requests.
usaco-guide/content/5_Gold/PURQ.mdx
2020-06-29 15:42:49 -04:00

55 lines
1.9 KiB
Text

---
id: PURQ
title: "Point Update Range Query"
author: Benjamin Qi
prerequisites:
description: Range queries for any associative operation over an array with updates using segment tree.
frequency: 1
---
import { Problem } from "../models";
export const metadata = {
problems: {
sample: [
new Problem("YS", "Point Set Range Composite", "point_set_range_composite", "Intro", false, ["PURQ"], ""),
],
general: [
new Problem("CSES", "Range Minimum Queries II", "1649", "Intro", false, ["PURQ"], ""),
new Problem("Gold", "Springboards", "995", "Normal", false, ["PURQ"], "min segtree"),
new Problem("Plat", "Nocross", "721", "Normal", false, ["PURQ"], "LIS variation"),
new Problem("Plat", "Slingshot", "816", "Hard", false, ["PURQ"], ""),
]
}
};
<problems-list problems={metadata.problems.sample} />
<br/>
A **segment tree** allows you to do point update and range query in $O(\log N)$ time each for any associative operation.
### Tutorials
<info-block title="Pro Tip">
For gold, you only need to know the basics (ex. sum, min queries). You can skip more advanced applications such as **lazy propagation** for now.
</info-block>
<resources>
<resource source="CSA" title="Segment Trees" url="segment_trees" starred>interactive</resource>
<resource source="CF" title="Efficient and easy segment trees" url="blog/entry/18051" starred>simple implementation</resource>
<resource source="CPH" title="9.3 - Segment Trees" starred>same implementation as above</resource>
<resource source="CPC" title="3 - Data Structures" url="03_data_structures" starred>see slides after union-find</resource>
<resource source="cp-algo" title="Segment Tree" url="data_structures/segment_tree.html" starred></resource>
<resource source="PAPS" title="11.2.3"></resource>
</resources>
### Problems
Can also try solving some of the BIT questions with segtree.
<problems-list problems={metadata.problems.general} />