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/4_Silver/2P.md
2020-06-17 15:18:07 -07:00

1.5 KiB

id title author prerequisites
2P Two Pointers Darren Yao
Silver - Sorting

Two pointers refers to iterating two monotonic pointers across an array to search for a pair of indices satisfying some condition in O(n) time.

Tutorials

  • Intro to USACO 14.1
  • CPH 8.1

Problems

Extensions

The two pointers technique can be extended to the two dimensional sliding window algorithm. If you're looking for a more challenging problem using 2-D sliding window, see USACO Plat Fort Moo.