4 subtopics · 16 problems
Greedy Algorithms
Make locally optimal choices that lead to a globally optimal solution.
01Sorting-Based Greedy
Sort first, then greedily pick or assign.
2 easy2 medium1 hard
| Problem | Difficulty | Link |
|---|---|---|
| 1850ATo My Critics | easy | Solve |
| 459APashmak and Flowers | easy | Solve |
| 1829CMr. Perfectly Fine | medium | Solve |
| 1843DApple Tree | medium | Solve |
| 1881EBlock Sequence | hard | Solve |
02Interval / Activity Selection
Classic interval scheduling, merging, and coverage problems.
1 easy2 medium1 hard
| Problem | Difficulty | Link |
|---|---|---|
| 1921BArranging Cats | easy | Solve |
| 1157C1Increasing Subsequence (easy) | medium | Solve |
| 1862CFlower City Fence | medium | Solve |
| 1904DSet To Max | hard | Solve |
03Exchange Argument
Prove greedy correctness by showing swapping any pair doesn't improve the answer.
1 easy2 medium1 hard
| Problem | Difficulty | Link |
|---|---|---|
| 1900BLaura and Operations | easy | Solve |
| 1881DDivide and Equalize | medium | Solve |
| 1216CWhite Sheet | medium | Solve |
| 1862EKolya and Movie Theatre | hard | Solve |
04Priority Queue Greedy
Use a heap to always process the best available option.
2 medium1 hard
| Problem | Difficulty | Link |
|---|---|---|
| 1399CBoats Competition | medium | Solve |
| 1353DConstructing the Array | medium | Solve |
| 1154DWalking Robot | hard | Solve |
Was this helpful?