# Circular warehouse belt design ## Goal The warehouse operator must install orthogonal circular belts and rotate them so that boxes leave through the exit in increasing management-number order. The operator supplies the input grid, and the submitted method chooses the belts and rotations. The score rewards removing more boxes and, when all boxes leave, using fewer rotations; the metric rejects an illegal submission. ## What You Have | path | what is in it | |---|---| | `/app/methods/main/` | your submission; it starts as the starter and `run.sh` is its entry point | | `/app/core/` | the shared input reader and metric; `CORE_DIR=/app/core` is set | | `/app/data/` | practice instance directories, each containing its input | | `/app/selfcheck.py` | the rehearsal command described below | Each practice instance has an `input.txt` file. Its first line gives the square grid side length; the following lines give one row of integer management numbers per grid row. Every cell has one distinct management number. The solver can open these files directly and should use the dimensions and values it reads there. The output domains are part of the belt problem. A belt count is from 0 through 400. A belt length is from 2 through 400. Each coordinate component is from 0 through 19. The operation count is from 0 through 100000. A belt index is from 0 through 399. A rotation direction is either -1 or 1. ## What You Submit Put a general method in `/app/methods/main/`; it must include `run.sh` and may include any supporting files it needs. The method is called as run.sh . Read input.txt from the data directory and write submission.txt in the output directory. The output file is `/app/methods/main/run.sh`'s `submission.txt` in the output directory. It first describes the belts: a belt count, then each belt's cycle as coordinate pairs. It then gives the rotation count and one belt index plus direction for each rotation. Each belt cycle must contain at least two distinct orthogonally adjacent cells, including the wraparound edge, and each cell may belong to at most two belts. A belt index must refer to a declared belt and a direction must be `-1` or `1`. The metric rejects malformed output and output outside the declared domains. ## Feasibility Before Cost A submission that violates any hard output constraint scores the failure value whatever its rotation cost. The metric also gives the failure value to illegal output. ## Budget The per-run budget is 2 seconds; `TASK_BUDGET_SEC` carries this value. The session is 4 CPUs, 16 GB of memory, and 12 hours with no network access. Grading uses 4 CPUs, 8 GB of memory, no network, and the per-run budget. The session and grading each have 10 GB of storage. ## How It Is Judged The metric simulates each submitted belt and rotation sequence on a sealed input. A complete output scores `1000000 + round(1000000 * log2(100000 / T))` when every box is removed after `T` rotations; an incomplete output scores `round(1000000 * B / 400)`, where `B` is the number removed. Illegal output scores 0. Higher scores are better. The metric's score is bounded from 0 through 17609640. The sealed instances and their answers are available only to the grading container. Their individual scores are combined as the arithmetic mean into the package score. The sealed side contains 1542 instances. The input is a square warehouse grid with one box per cell and distinct integer management numbers. The exit is the top row's middle cell, and box 0 is removed before operations if it starts there. A belt is a simple orthogonal cycle of at least two distinct cells; each cell may belong to at most two belts. An operation shifts one chosen belt by one cell in direction -1 or +1, and no more than the stated operation limit may be output. A box is removed only when it is at the exit and is the smallest remaining management number. ## Self-check Run `python3 /app/selfcheck.py rehearse`. It executes the method on every practice instance with the same staging, user, budget, and metric used for grading. Its final line is `{"score": …}`; that score is a smoke test for the arithmetic mean over practice-instance scores, not the graded score.