Learning paths

Solves Bronze problems independently

USACO Silver

  • 30 lessons
  • About 60 minutes per lesson

Scale direct Bronze solutions to larger inputs. Practise prefix sums, two pointers, binary search on the answer, traversal and basic greedy methods, and explain when each applies.

View the syllabus

What you’ll be able to do

  • Compare brute-force and improved solutions using constraints.
  • Implement interval queries, monotone feasibility checks or connectivity traversals.
  • Verify solutions with counterexamples, brute-force comparisons and complexity analysis.

Course syllabus

Open a module for the lesson breakdown, a worked example and an assignment.

  1. Lessons 1–5 Complexity and prefix sums

    Rule out slow solutions using constraints and preprocess repeated interval calculations.

    • Estimate work from n, query count and loop nesting.
    • Build a one-dimensional prefix sum with an initial zero.
    • Derive the inclusive range formula and check endpoints.
    • Replace sums with cumulative counts for a category.
    • Test negative values, endpoint indexes and 64-bit totals.
    Open lessons, example and homework →
  2. Lessons 6–10 Sorting, two pointers and sliding windows

    Exploit ordering or window properties to avoid scanning candidates repeatedly.

    • Find a target sum with two pointers on sorted values.
    • Explain why a pointer move cannot skip a valid pair.
    • Maintain a contiguous window under a sum limit in a nonnegative array.
    • Show that each pointer moves at most n times.
    • Build a negative-value counterexample and identify the failed window assumption.
    Open lessons, example and homework →
  3. Lessons 11–15 Binary search on the answer

    Write a feasibility check and find the smallest or largest valid value in a monotone range.

    • Derive a feasibility predicate from the problem statement.
    • Prove that feasibility changes monotonically with the candidate value.
    • Find the first feasible value with inclusive bounds.
    • Derive a search range that contains the answer.
    • Use enumeration to check minimum, maximum and exact-feasibility cases.
    Open lessons, example and homework →
  4. Lessons 16–20 Graphs, grids and connectivity

    Use BFS and DFS to find what is reachable from a starting point.

    • Represent an undirected graph with adjacency lists and include isolated nodes.
    • Implement DFS with visited and an explicit stack.
    • Use a queue for BFS and record unweighted distances.
    • Find all connected components in a four-neighbour grid.
    • Check disconnected nodes, cycles and revisits.
    Open lessons, example and homework →
  5. Lessons 21–25 Intervals and basic greedy methods

    Choose a greedy rule for the objective and check it with an exchange argument or counterexample.

    • Distinguish closed and half-open intervals and touching endpoints.
    • Sort and merge overlapping intervals.
    • Select a maximum number of nonoverlapping activities by finish time.
    • Explain earliest-finish selection by exchanging the first activity.
    • Refute earliest-start selection with one long activity and several short ones.
    Open lessons, example and homework →
  6. Lessons 26–30 Mixed practice and solution review

    Select a method from the constraints and problem properties and verify it on small data.

    • Read past problems and mark signals for intervals, monotonicity and connectivity.
    • Write a small reference solution for tasks from two categories.
    • Implement efficient versions and compare using random small inputs and fixed boundaries.
    • Document each solution’s assumptions and worst-case cost.
    • Review one mistaken choice and add a distinguishing counterexample.
    Open lessons, example and homework →

A sample exercise

For array [2,-1,4,3] with zero-based indexes, query inclusive interval [1,2].

See the worked example →

Common questions

What is the first lesson?

Estimate work from n, query count and loop nesting. · Complexity and prefix sums

How can I check my progress?

Complete a mixed set and submit explanations, code, edge cases and costs for at least two problem types. Identify the property each solution relies on, such as monotonicity or connectivity.