Learning together

Choosing a contest

Contest submission troubleshooting checklist

A tabby cat reviews a discrepancy on a chart

Use verdicts to diagnose compilation errors, runtime errors, wrong answers and timeouts.

Check input, output and the sample before submitting

  1. Mark the input format, required output and constraints. Identify whether the task uses standard streams or named files.
  2. Rerun the sample from the exact source file you plan to upload. Remove debugging output and prompts.
  3. Predict the result of a minimum input and a case that can reveal an error, such as equality, duplicates, no remaining space or a strict update order.
  4. Record the problem, language, first verdict and change you made.

Start with the verdict

Verdict Check first Verify
Compilation error Selected language, source file and first diagnostic Compile that same file locally
Runtime error or missing output Input, array bounds, filenames and working directory Run the smallest case and capture the first error
Wrong answer Comparisons, update order, edge cases and output format Trace a failing input by hand and find the first mismatch
Time limit Work at maximum input size and repeated scans Estimate complexity and run a valid large test

Catch an update-order bug with a tiny example

In Shell Game, consider one turn: swap shells 1 and 2 and guess 2. For a pebble starting under shell 1, it moves to shell 2 before the guess scores a point. A trace that logs zero before moving the pebble reveals the first error. The overall maximum can coincide even for the wrong code, so check the per-start trace as well as the final answer.

Once fixed, rerun this case, the sample and previous passing tests, then resubmit. See the official USACO instructions for examples of legacy filenames and contest rules.