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/Tree_Euler.mdx
2020-06-26 17:12:04 -04:00

54 lines
No EOL
1.7 KiB
Text

---
id: tree-euler
title: "Euler Tour on Tree"
author: "?"
prerequisites:
- Silver - Depth First Search
- Gold - Static Range Queries
- Gold - Point Update Range Sum
description: Subtree updates and queries as well as a way to compute lowest common ancestors.
frequency: 2
---
import { Problem } from "../models";
export const metadata = {
problems: {
sample: [
new Problem("CSES", "Subtree Queries", "1137", "Easy", false, ["Euler-Tree"], "equivalent to https://judge.yosupo.jp/problem/vertex_add_subtree_sum"),
],
lca: [
new Problem("CSES", "Company Queries II", "1688", "Easy", false, ["LCA"], ""),
],
problems: [
new Problem("CSES", "Distance Queries", "1135", "Easy", false, ["LCA"], ""),
new Problem("CSES", "Path Queries", "1138", "Easy", false, ["Euler-Tree","PURS"], "equivalent to https://judge.yosupo.jp/problem/vertex_add_path_sum"),
new Problem("Gold", "Cow Land", "921", "Normal", false, ["Euler-Tree","PURS", "HLD"], ""),
new Problem("Gold", "Milk Visits", "970", "Normal", false, ["Euler-Tree", "LCA"], ""),
new Problem("Plat", "Promotion Counting", "696", "Normal", false, ["Euler-Tree","PURS"], ""),
new Problem("ojuz", "IOI Regions", "IOI09_regions", "Hard", false, ["Euler-Tree", "Binary Search"], ""),
new Problem("Plat", "Snow-Cow", "973", "Hard", false, ["Euler-Tree","PURS"], ""),
]
}
};
## Introduction
<problems-list problems={metadata.problems.sample} />
### Tutorial
- CPH 18.2 - Subtrees & Paths
## LCA
### Tutorial
- CPH 18.3 - Least Common Ancestor
- [cp-algorithms - LCA with Sparse Table](https://cp-algorithms.com/graph/lca.html)
(implementation)
## Problems
<problems-list problems={metadata.problems.problems} />