Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktopgrid · tiling · dynamic-programming · optimization
The organizer’s problem statement is available at the official source link.
domino tiling
Tile the two-row grid for maximum score
Cover every cell of the 2-by-N grid exactly once with 2-by-1 tiles. A tile scores the difference between its two covered values.
| top: a1 | a2 | ... |
| bottom: b1 | b2 | ... |
- 1
Place legal tiles
Each tile covers two adjacent cells; tiles cannot overlap and every cell must be covered. - 2
Score each tile
A tile contributes the larger covered value minus the smaller covered value. - 3
Maximize the total
Choose a complete tiling with the greatest sum of tile scores.
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.