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

54 lines
1.7 KiB
Text
Raw Normal View History

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