Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktopsimulation · 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.
| Command | Position | Holding | Stack |
|---|---|---|---|
| move | p | h | s |
| pick/drop | p_next | h_next | s_next |
- 1
Initialize crane
Initialize stack heights, crane position, and empty hand. - 2
Apply commands
Apply each command with the boundary, empty-stack, and capacity rules. - 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 charsRun output
Run your code to see output.