Skip to content

Berth occupancy point and range-maximum queries at scale

Exact prompt

# Marina berth occupancy queries at scale `input.json` (synthetic) has `bookings` ([start, end) integer minute pairs), `points` (integer times) and `ranges` ([l, r) pairs). Write `solve.py` (Python 3 standard library only); `python solve.py input.json answer.json`. One hidden input has **150,000 bookings and about 300,000 queries and must finish within 20 seconds** (other runs: 30 s). Answers must be exact. ## Rules 1. A booking with start > end is invalid: count it in `invalid_bookings` and ignore it. A booking with start == end is ignored (not invalid). Duplicate bookings count separately. 2. Occupancy at integer time t = number of valid bookings with start <= t < end. 3. `points`: occupancy at each time, in input order. 4. `ranges`: for each [l, r): if l >= r the answer is null; otherwise the maximum occupancy over all integer t with l <= t < r. In input order. 5. `peak` = maximum occupancy over all times (0 if there are no valid bookings); `peak_first_time` = the earliest time it is reached (null if peak is 0). ## answer.json `{"invalid_bookings", "peak", "peak_first_time", "points": [...], "ranges": [...]}` ## Scoring Hidden checks (partial credit; all must pass; all exact): `invalid_and_peak`, `point_queries`, `range_max_queries` on the given input; `fresh_run_1`, `fresh_run_2`; `big_150k_bookings_300k_queries_20s`.

The rules are simple and a brute-force answer is correct on small inputs, so separation comes from choosing a sweep plus range-maximum structure and getting the half-open boundaries right. Original benchmark task written for usecaserank.com (not based on a specific public post). Headless, offline run on a reproducible fixture. Each run's notes say how its cost was measured (estimates are marked).

Success criteria: 1. invalid_and_peak 2. point_queries 3. range_max_queries 4. fresh_run_1 5. fresh_run_2 6. big_150k_bookings_300k_queries_20s

Best model for this task so far: Claude Haiku 5.5 (effort default (no --effort flag) · thinking on) (success, $0.0072, 43s).

Run this on another model

All runs (4)

100% pass rate across 4 eligible runs: 4 pass, 0 partial, 0 fail. Partial and failed runs are listed below with everything else.ⓘ

Runs for this use case
ModelCostTimeStep-insⓘAutonomyOutcomeTrustⓘDateCompare
OGPT-6.1 Soldefault · thinking on$0.0453s0Fully autonomouspassTrust 80%2026-10-22
AClaude Haiku 5.5default · thinking on$0.007243s0Fully autonomouspassTrust 80%2026-10-20
AClaude Opus 5.5default · thinking on$0.1440s0Fully autonomouspassTrust 80%2026-10-20
AClaude Sonnet 5.5default · thinking on$0.0516s0Fully autonomouspassTrust 80%2026-10-20

Embed this result

A live badge for this use case. It links back here and updates as new runs are published.

UseCaseRank badge for Berth occupancy point and range-maximum queries at scale

Get new runs and ranking changes weekly

Which models got better or cheaper on real tasks like this one.