USACO Silver Tips

Does anyone have any tips/tricks to learn algorithms for USACO Silver and to get to gold?

Thanks!

1 Like

In terms of tips, just follow what is given on the main USACO guide website. You can learn the algorithms in any order, but I usually recommend the below:

  • Understanding of time complexity (know the time complexity for all algorithms you learn; it can also help you reverse engineer which algorithm a solution might use given the bounds on variables)
  • Basic graphs (representations in adjacency list/matrix and tradeoffs, and DFS along with its application to floodfill)
  • Prefix sums and difference arrays to avoid recomputation
  • Binary searching a sorted list of items
  • Sorting (the sort function in STL and concepts from bubble sort)
  • STL data structures (beyond arrays): vectors, (multi)sets, (multi)maps, stacks/queues/deques
  • Two pointer technique

Practice diligently.

1 Like

Thanks for your reply! I haven’t learned multisets/maps or vectors so I think I will do that.

You should definitely prioritize learning vectors. There are tons of use cases, especially for graph problems (adjacency lists are just an array of vectors or a vector of vectors), which occur pretty frequently, or just cases when you need a dynamic array (no fixed size). Vectors even sometimes show up in bronze. And yes, after that, learn the others: sets, maps, stacks, queues.

Vectors are like arraylists for Java right?

Yes, I believe arraylists in Java are pretty similar to how vectors work.

Just do more problems…
that’s my only advice;zz)

1 Like