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/DP_Trees.md

41 lines
1.5 KiB
Markdown
Raw Normal View History

2020-06-09 16:36:07 +00:00
---
2020-06-15 23:19:07 +00:00
id: dp-trees
2020-06-09 16:36:07 +00:00
title: "Dynamic Programming on Trees"
author: Michael Cao
prerequisites:
2020-06-22 20:51:12 +00:00
- Silver - Depth First Search
- Gold - Introduction to Dynamic Programming
2020-06-22 19:59:16 +00:00
description: What it sounds like.
2020-06-09 16:36:07 +00:00
---
## Tutorial
* [DP on Trees (Codeforces)](https://codeforces.com/blog/entry/20935)
2020-06-22 19:59:16 +00:00
* [NOI PDF (Philippines)](https://noi.ph/training/weekly/week5.pdf)
2020-06-09 16:36:07 +00:00
## Problems
2020-06-22 04:00:36 +00:00
<info-block title="Pro Tip">
Don't just dive into trying to figure out a DP state and transitions -- make some observations if you don't see any obvious DP solution!
</info-block>
2020-06-11 01:25:17 +00:00
2020-06-23 02:17:59 +00:00
- USACO
- [Gold - Barn Painting](http://www.usaco.org/index.php?page=viewproblem2&cpid=766)
- Similar to Independent Set
- [Gold - Delegation](http://usaco.org/index.php?page=viewproblem2&cpid=1019)
- Pretty much a greedy problem.
- [Plat - Delegation](http://www.usaco.org/index.php?page=viewproblem2&cpid=1020)
- Binary search on answer!
- Other
- [CSES - Tree Matching](https://cses.fi/problemset/task/1130)
- [Subtree](https://atcoder.jp/contests/dp/tasks/dp_v)
- [Independent Set](https://atcoder.jp/contests/dp/tasks/dp_p)
- [BOI - Cat In A Tree](https://cses.fi/file/a904421da451fbe1b60f96a27256832a011825dfd097ee40184d15878e837018/)
- Observations first.
- [COCI - Dzumbus](https://oj.uz/problem/view/COCI19_dzumbus)
- Solve child subtree by subtree. Runtime may be faster than you think.
- [Ostap and Tree](https://codeforces.com/problemset/problem/735/E)