Two skills that decide ICPC results as much as algorithms: implementing ugly problems cleanly, and writing standard structures correctly the first time.

Implementation techniques

SituationTechnique
simulationkeep the state in one struct; one function step(); assert invariants after each step; detect cycles by hashing states
events in timesort events by (time, type) with a clear tie rule; sweep and maintain a structure
gridsdirection arrays dr[] = {-1, 0, 1, 0}, dc[] = {0, 1, 0, -1}; an inside(r, c) helper; pad with a border instead of bounds checks
rotations / reflectionswrite rotate90 once and reuse it; normalize shapes by the minimum over all 8 symmetries
coordinatescompress early; half-open intervals everywhere
parsingread tokens with cin; recursive descent for expressions (`expr → term (+
state machinesan enum for states, a transition table, no nested if chains
heavy caseworknormalize by symmetry first; represent cases as data (a table) rather than code; brute force small inputs and compare
dates and timesconvert to a single integer (days or seconds since an epoch), compute, convert back

Implementation reliability

HabitWhy
a tested library: segment tree, lazy segment tree, Fenwick, DSU, Dinic, min-cost flow, LCA, HLD, hashing, geometry primitivestyped from memory or the team notebook, it has no bugs
invariants as commentsa loop with a stated invariant (“lo is always bad”) is rarely off by one
one convention per problem0-indexed, half-open, long long for sums
small functions with clear inputseach can be tested alone
read the code once before running itcatches most typos faster than debugging
stress test whenever the solution is not obviously correctrandom small tests against a brute force catch logic errors in minutes

Writing standard structures without debugging

StructureThe usual bugGuard
segment treewrong size, wrong mid split, forgetting to push lazy tagssize (recursive) or power of two; push at the top of every function
Fenwick tree0-indexingshift indices by one at the interface
DSUunion without findalways a = find(a), b = find(b) first
Dinicmissing reverse edges, level graph not resetadd edges in pairs; reset level and it per phase
Dijkstraprocessing stale queue entriesif (d > dist[u]) continue;
geometryprecision, collinear casesintegers where possible; handle collinear explicitly
DPwrong base case or iteration orderwrite the recurrence and order on paper; test tiny inputs by brute force
graphs0/1-indexed vertices, multi-edges, disconnected graphsread the input format twice

See also Debugging and Stress Testing, 🐬 Before Contest, 🐬 Snippets.