← CSES Better

Video Game

ZCO · 2014 · Zonal Computing Olympiad · ZCO14001

Open official problem ↗
Ask AI

Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.

Open Claude Desktop

simulation · state-machine · arrays

The organizer’s problem statement is available at the official source link.

crane state

Simulate the crane state one command at a time

The crane has a current stack position and carries either zero or one box; ignored commands leave state unchanged.

State table
CommandPositionHoldingStack
movephs
pick/dropp_nexth_nexts_next
  1. 1

    Initialize crane

    Initialize stack heights, crane position, and empty hand.
  2. 2

    Apply commands

    Apply each command with the boundary, empty-stack, and capacity rules.
  3. 3

    Read final stacks

    Report the final stack heights after the command stream.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 chars

Run output

Run your code to see output.