Skip to main content

AtCoder · AHC058

Apple Incremental Game

Allocate apples across a four-level production hierarchy and compound machine output over 500 turns.

01

Task

Each Case contains ten machine IDs at each of four production levels. The system starts with one apple and runs for 500 turns.

On each turn the Policy strengthens at most one affordable machine or waits. Production then runs in level order, so investment timing and cross-level compounding determine the final apple count.

02

Policy interface

The evolving state is fully public. Capacities and initial costs appear once and can be retained in same-Episode Policy memory.

Observation fieldMeaning
turn / turns_remainingCurrent temporal state
applesCurrent spendable apples
machines4 × 10 machine counts
powers4 × 10 current production powers
initialCapacities and initial costs; first observation only

Choose one machine upgrade or wait. The selected level and machine ID must be in range and affordable.

ActionMeaning
{"upgrade": [level, machine_id]}Strengthen one machine before production
NoneWait for one turn
03

Evaluation

QuantityDefinition
Episode scoreround(100,000 × log2(final apples))
Benchmark scoreArithmetic mean of Episode scores
Policy failureContributes 0
04

Feedback

Feedback connects the primary score to final production scale, upgrade count, completion, and bounded transition coverage.

FieldMeaning
mean_log2_scorePrimary Benchmark score
mean_final_applesMean final apple count
mean_total_upgradesMean upgrade count
completed / policy_failuresEpisode outcome counts
trace.jsonlA bounded turn sequence containing public production state and selected upgrades.
05

Using the distribution

Build this independently installable leaf project from the repository root:

uv sync --project environments/atcoder/ahc058/apple_incremental_game --extra dev
uv build environments/atcoder/ahc058/apple_incremental_game

The package exports:

from apple_incremental_game import AppleIncrementalGameBenchmark, baseline_program

benchmark = AppleIncrementalGameBenchmark()
program = baseline_program()