Learning paths

Ready for a contest problem

USACO Bronze

  • 30 lessons
  • About 60 minutes per lesson

Turn contest statements into programs you can trace step by step. Practise reading, simulation, enumeration, sorting, counting and submission, then apply the workflow to past Bronze problems.

View the syllabus

What you’ll be able to do

  • Identify input, output, constraints and the variables to maintain.
  • Simulate rules, enumerate legal candidates and organise data by order or frequency.
  • Find mistakes with boundary cases and submit and review under the problem’s requirements.

Course syllabus

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

  1. Lessons 1–5 Statements, constraints and state

    Extract inputs, outputs and the quantities that change at each step.

    • Identify input and output lines and indexing rules.
    • Mark initial conditions, operations and the final objective.
    • Model the current situation with the smallest useful state.
    • Trace the official sample and check each state change.
    • Use constraints to construct minimum, equality and extreme cases.
    Open lessons, example and homework →
  2. Lessons 6–10 Step-by-step simulation

    Update positions, capacities or scores in the prescribed order.

    • Represent the pebble’s position with one integer.
    • Handle swaps when the position matches the left, the right or neither shell.
    • Separate state updates from scoring after a move.
    • Simulate pouring between containers, bounded by free capacity.
    • Check unchanged states, repetitions and bounds on intermediate values.
    Open lessons, example and homework →
  3. Lessons 11–15 Enumerating and comparing candidates

    Try every feasible option and keep the best under the stated rule.

    • List legal start states and check that enumeration is complete.
    • Reset state and score for each candidate.
    • Enumerate pairs with i < j to avoid duplicates and self-pairs.
    • Apply the tie-breaking rule when several candidates are optimal.
    • Estimate total work as candidates times simulation steps.
    Open lessons, example and homework →
  4. Lessons 16–20 Sorting, frequencies and missing values

    Turn repeats and gaps into counts you can verify.

    • Check adjacent values for repeats after sorting.
    • Build a frequency table and explain its key-range requirements.
    • Count sparse values with a map and query absent keys.
    • Find the smallest missing nonnegative integer by scanning from 0.
    • Check repeated records, consecutive values and a missing 0.
    Open lessons, example and homework →
  5. Lessons 21–25 Grids, coordinates and boundaries

    Express movement and local neighbours with clear coordinate rules.

    • Use row and column positions and distinguish x from row.
    • Apply a sequence of directions to update coordinates.
    • Enumerate four neighbours and check bounds first.
    • Track duplicate visits with a set.
    • Test a boundary start, a return to the origin and a minimal grid.
    Open lessons, example and homework →
  6. Lessons 26–30 Timed practice and review

    Work independently through reading, testing, submission and review on three problems.

    • Survey three tasks and note constraints and likely approaches.
    • Solve a simulation task and compare code with a hand trace.
    • Solve an enumeration or counting task and check its worst-case cost.
    • Use the specified I/O and log test or submission feedback.
    • Select the trickiest task and review it with a counterexample and a fix.
    Open lessons, example and homework →

A sample exercise

A pebble starts under shell 1. Swap 1 with 3, then 1 with 2. Where does the pebble finish?

See the worked example →

Common questions

What is the first lesson?

Identify input and output lines and indexing rules. · Statements, constraints and state

How can I check my progress?

Complete a three-problem Bronze practice set. Submit reading notes, a sample trace and complexity for each problem, plus code for solved tasks and a review of where you got stuck on others.