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/6_Plat/1_Plat_Trees.md

86 lines
2.3 KiB
Markdown
Raw Normal View History

2020-06-04 02:09:42 +00:00
---
slug: /plat/trees
2020-06-04 05:39:49 +00:00
title: "Trees"
2020-06-04 03:26:53 +00:00
author: Benjamin Qi
2020-06-04 05:39:49 +00:00
order: 1
2020-06-05 00:21:03 +00:00
prerequisites:
-
2020-06-05 00:37:02 +00:00
- Silver - Depth First Search
2020-06-04 02:09:42 +00:00
---
2020-06-04 21:42:30 +00:00
Lowest Common Ancestor and other tree topics.
2020-06-04 05:39:49 +00:00
<!-- END DESCRIPTION -->
2020-06-03 14:17:07 +00:00
2020-06-04 03:26:53 +00:00
## Tree Diameter
### Tutorial
- CPH 14.2
### Problems
- [USACO Plat Newbarns](http://www.usaco.org/index.php?page=viewproblem2&cpid=817)
- Copy of [Brain Network "Hard"](https://codeforces.com/contest/690/problem/C3)
2020-06-04 13:54:18 +00:00
- [Tree Construction](https://csacademy.com/contest/archive/task/tree-construct)
2020-06-04 03:26:53 +00:00
## Lowest Common Ancestor
### Tutorial
- CPH 18
- [cp-algorithms: Lowest Common Ancestor](https://cp-algorithms.com/)
### Problems
2020-06-04 13:54:18 +00:00
USACO:
2020-06-04 03:26:53 +00:00
- [USACO Plat Max Flow](http://www.usaco.org/index.php?page=viewproblem2&cpid=576)
- [USACO Gold Milk Visits](http://www.usaco.org/index.php?page=viewproblem2&cpid=970)
- [USACO Gold Cow Land](http://www.usaco.org/index.php?page=viewproblem2&cpid=921)
- LCA + BIT
- [USACO Plat Promote](http://www.usaco.org/index.php?page=viewproblem2&cpid=696)
- Subtree + BIT
- [USACO Plat Disrupt](http://www.usaco.org/index.php?page=viewproblem2&cpid=842)
- HLD is possible, but just do binary jumps
- [USACO Plat Tree Boxes](http://www.usaco.org/index.php?page=viewproblem2&cpid=948)
- interactive!!
- [USACO Plat Gathering](http://www.usaco.org/index.php?page=viewproblem2&cpid=866)
- [USACO Plat Exercise](http://www.usaco.org/index.php?page=viewproblem2&cpid=901)
- tricky
2020-06-04 13:54:18 +00:00
Other:
- [Hot & Cold](https://dmoj.ca/problem/bts17p7) [](105)
- [Root LCA Queries](https://csacademy.com/contest/archive/task/root-lca-queries/) [](107)
2020-06-04 03:26:53 +00:00
## Centroid Decomposition
2020-06-04 13:54:18 +00:00
### Tutorial
- [GeeksForGeeks](http://www.geeksforgeeks.org/centroid-decomposition-of-tree/)
- [Carpanese](https://medium.com/carpanese/an-illustrated-introduction-to-centroid-decomposition-8c1989d53308)
### Problems
2020-06-04 03:26:53 +00:00
- [USACO Plat - At Large](http://www.usaco.org/index.php?page=viewproblem2&cpid=793)
- very tricky
- [DMOJ Bob Equilibrium](https://dmoj.ca/problem/dmopc19c7p6)
## Heavy-Light Decomposition
2020-06-04 13:54:18 +00:00
- probably not intended solution, but can help (ex. for "Disrupt")
### Tutorial
- [Anudeep2011](https://blog.anudeep2011.com/heavy-light-decomposition/)
- [AI-Cash](http://codeforces.com/blog/entry/22072)
- [adamant](https://codeforces.com/blog/entry/53170)
2020-06-04 21:42:30 +00:00
### Problems
??
2020-06-04 13:54:18 +00:00
## Small to Large (Offline)
??