1.6 KiB
1.6 KiB
id | title | author |
---|---|---|
binary-search | Binary Search on the Answer | Darren Yao |
Binary Searching on the Answer
Oftentimes used when you need to find the minimum or maximum of some quantity such that it satisfies some property.
Tutorial
- Intro to USACO 12.1
Problems
- USACO
- USACO Silver - Cow Dance
- binary search on
K
and simulate
- binary search on
- USACO Silver - Convention
- determine whether
M
buses suffice if every cow waits at mostT
minutes - use a greedy strategy (applies to next two problems as well)
- determine whether
- USACO Silver - Angry Cows
- check in
O(N)
how many haybales you can destroy with fixed radiusR
- check in
- USACO Silver - Social Distancing
- check in
O(N+M)
how many cows you can place with distanceD
- check in
- USACO Silver - Loan Repayment
- requires some rather tricky analysis to speed up naive
O(N\log N)
solution
- requires some rather tricky analysis to speed up naive
- USACO Silver - Cow Dance
- CF