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/Bin_Jump.md
2020-06-24 16:50:30 -04:00

60 lines
No EOL
2.1 KiB
Markdown

---
id: bin-jump
title: "Binary Jumping"
author: Benjamin Qi
description: Introduces the problems of finding level ancestors in a tree and computing the lowest common ancestors.
---
<problems-list>
<problem name="Planet Queries I" cses="1750" difficulty="Easy" tags={["Binary Jumping"]}>
</problem>
<problem name="Company Queries I" cses="1687" difficulty="Easy" tags={["Binary Jumping"]}>
</problem>
<problem name="Company Queries II" cses="1688" difficulty="Easy" tags={["LCA"]}>
</problem>
</problems-list>
## Binary Jumping
## Lowest Common Ancestor
### Tutorial
- CPH 18.1, 18.3
- [cp-algorithms](https://cp-algorithms.com/)
<optional-content title="Improvements">
- [CF: $O(\log N)$ queries and $O(N)$ memory](https://codeforces.com/blog/entry/74847)
- [Wikipedia: $O(1)$ queries and $O(N)$ preprocessing time](https://en.wikipedia.org/wiki/Level_ancestor_problem#Ladder_algorithm)
- though explanation is not the greatest
</optional-content>
### Problems
<problems-list>
<problem name="Distance Queries" cses="1135" difficulty="Easy" tags={["LCA"]}>
</problem>
<problem name="Plat - Max Flow" usaco="576" difficulty="Easy" tags={["LCA"]}>
</problem>
<problem name="Root LCA Queries" csa="root-lca-queries" difficulty="Normal" tags={["LCA"]}>
</problem>
<problem name="Planets Queries II" cses="1160" difficulty="Normal" tags={["LCA"]}>
</problem>
<problem name="Plat - Disruption" usaco="842" difficulty="Normal" tags={["LCA"]}>
</problem>
<problem name="Hot & Cold" dmoj="bts17p7" difficulty="Normal" tags={["LCA"]}>
</problem>
<problem name="Plat - Tree Boxes" usaco="948" difficulty="Hard" tags={["LCA"]}>
- interactive!!
</problem>
<problem name="Plat - Newbarns" usaco="817" difficulty="Hard" tags={["Diameter"]}>
Copy of [CF Brain Network "Hard"](https://codeforces.com/contest/690/problem/C3)
</problem>
<problem name="Plat - Gathering" usaco="866" difficulty="Hard" tags={["LCA"]}>
- interactive!!
</problem>
<problem name="Plat - Exercise" usaco="901" difficulty="Very Hard" tags={["LCA"]}>
</problem>
</problems-list>