Skip to main content

AtCoder · AHC054

Treant’s Forest

Place permanent Treants on unseen cells to delay a deterministic adventurer while preserving a route to the flower.

01

Task

Each Case is a 20–40 cell square forest with an entrance, a flower, fixed trees, and an adventurer. Before every adventurer move, the Policy may place permanent Treants on cells that have not yet been revealed.

A placement set is applied atomically. It must leave both the entrance and the current adventurer position connected to the flower. The adventurer then reveals sight lines and follows a deterministic shortest path toward a private target.

02

Policy interface

The first observation publishes the static forest. Later observations publish only the evolving public state; same-Episode Policy memory can retain the map and prior placements.

Observation fieldMeaning
turnCurrent turn index
adventurerCurrent adventurer coordinate
newly_revealedCells revealed by the preceding move
revealed_cells / placed_treantsPublic progress counters
initialSize, entrance, flower, and fixed trees; first observation only

Return one atomic placement set. An empty set advances the adventurer without placing a Treant.

ActionMeaning
{"placements": [[row, column], ...]}Place distinct Treants on valid unseen empty cells
{"placements": []}Place nothing this turn
03

Evaluation

QuantityDefinition
Episode contributionValid adventurer movement count, capped at 2,048
Benchmark scoreArithmetic mean of Episode contributions
Policy failureContributes 0
04

Feedback

Feedback summarizes delay, placements, terminal outcomes, failures, and trace coverage across the evaluated Cases.

FieldMeaning
capped_mean_turnsPrimary Benchmark score
mean_placed_treantsMean number of permanent placements
flower_reached / turn_cap_reachedTerminal outcome counts
policy_failuresFailed Episode count
trace.jsonlA bounded semantic trace of public observations, placement sets, and terminal outcomes.
05

Using the distribution

Build this independently installable leaf project from the repository root:

uv sync --project environments/atcoder/ahc054/treants_forest --extra dev
uv build environments/atcoder/ahc054/treants_forest

The package exports:

from treants_forest import TreantsForestBenchmark, baseline_program

benchmark = TreantsForestBenchmark()
program = baseline_program()