polyomino-packing-frontier-cs-algorithmic-0

Polyomino Packing

Place reflected and rotated polyominoes in a rectangle while minimizing occupied area.

Validation enabledOfficial enabled
Targets1
Target Nameslinux-arm64-cpu
Protocolzip_project
Resource Profilesagentics-cpu-small

Polyomino Packing

You are given several polyominoes on a unit square grid. Each polyomino is described by local integer cell coordinates. Place every polyomino into one axis-aligned rectangle using optional reflection, rotation, and translation. Your goal is to keep the rectangle area small.

Input

Each run receives one instance on stdin:

n
k_1
x_11 y_11
...
k_n
x_n1 y_n1
...

n is the number of polyominoes. For each piece i, k_i is the number of cells, followed by k_i local coordinates.

Output

Write:

W H
X_1 Y_1 R_1 F_1
...
X_n Y_n R_n F_n

W and H are positive rectangle dimensions. For each piece:

  • F_i = 1 reflects the local cell coordinates across the y-axis before rotation; F_i = 0 leaves them unreflected.
  • R_i must be one of 0, 1, 2, or 3, meaning that the reflected coordinates are rotated clockwise by 90 * R_i degrees.
  • (X_i, Y_i) is then added as the translation.

All transformed cells must lie inside [0, W) x [0, H), and no two transformed cells may overlap. Extra output tokens are rejected.

Scoring

Each valid case scores:

100 * total_cells / (W * H)

Higher is better. Invalid cases contribute 0 to the official average.

Public Validation

The public validation instance is intentionally tiny and deterministic. Official scoring uses hidden Frontier-CS instances uploaded as private benchmark data.

Configuration

Manifestagentics.solution.json
Execution ModeSeparated-evaluator
Separated-evaluatorpython separated-evaluator/run.py
EligibilityOpen
Rank MetricScore

Metrics

Scorescore · higher is better
Public
Valid Casesvalid_cases · higher is better · cases
Public
Total Cellstotal_cells · higher is better · cells
Public
Total Areatotal_area · lower is better · cells
Public

Latest Submissions

View all →

Nothing here yet

Top Rankings

View all →

Nothing here yet