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/Hull.mdx

71 lines
2.7 KiB
Text

---
id: hull
title: "Convex Hull"
author: Benjamin Qi
description: Smallest convex polygon containing a set of points on a grid.
prerequisites:
- Platinum - Geometry Primitives
frequency: 2
---
import { Problem } from "../models";
export const metadata = {
problems: {
sample: [
new Problem("Kattis", "Convex Hull", "convexhull", "Intro", false, ["convex"], ""),
],
sample2: [
new Problem("Kattis","Robert Hood", "roberthood", "Intro", false, ["convex"], "doesn't require convex hull since coordinates are small"),
],
general: [
new Problem("Plat", "Balance Beam", "864", "Easy", false, ["convex"], ""),
new Problem("CF", "Water Balance", "problemset/problem/1299/C", "Easy", false, ["convex"], ""),
new Problem("CF", "Geometers Anonymous", "problemset/problem/1195/F", "Normal", false, ["convex", "PURS"], ""),
new Problem("Old Gold", "Cow Curling", "382", "Normal", false, ["convex"], "testing whether points are inside hull"),
new Problem("AC", "AGC E - Random Pawn", "https://atcoder.jp/contests/agc044/tasks/agc044_e", "Very Hard", false, ["convex"], ""),
],
rotating: [
new Problem("Kattis", "Fence Orthogonality", "fenceortho", "Normal", false, ["convex"], "enclosing rectangle"),
],
cht: [
new Problem("Plat", "Circular Barn", "626", "Normal", false, ["DP", "convex"], ""),
new Problem("Plat", "Falling Portals", "998", "Hard", false, ["convex"], ""),
],
}
};
## [Convex Hull](https://en.wikipedia.org/wiki/Convex_hull_algorithms)
<problems-list problems={metadata.problems.sample} />
### Tutorial
- Graham Scan
- [cp-algo](https://cp-algorithms.com/geometry/grahams-scan-convex-hull.html)
- [My Implementation](https://github.com/bqi343/USACO/blob/master/Implementations/content/geometry%20(13)/Polygons/ConvexHull2.h)
- Monotone Chain
- CPH 30.3 (brief)
- [Wikipedia](https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain)
- [My Implementation](https://github.com/bqi343/USACO/blob/master/Implementations/content/geometry%20(13)/Polygons/ConvexHull%20(13.2).h)
<problems-list problems={metadata.problems.general} />
## Rotating Caliphers
<problems-list problems={metadata.problems.sample2} />
<resources>
<resource source="CF" title="Rotating calipers technique and applications" url="blog/entry/46162"> </resource>
</resources>
<problems-list problems={metadata.problems.rotating} />
## Convex Hull Trick
<resources>
<resource source="cp-algo" title="Convex Hull Trick" url="geometry/convex_hull_trick.html" starred> </resource>
<resource source="CF" title="Convex Hull Trick - Geo Being Useful" url="blog/entry/63823" starred> </resource>
</resources>
<problems-list problems={metadata.problems.cht} />