Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktoptiling · dynamic-programming · profile-dp
The organizer’s problem statement is available at the official source link.
tiling frontier
Only the unfinished frontier affects the next column
Tiles span up to three columns, so a column mask records cells already occupied by tiles extending from the left.
| A | A | B |
| A | A | B |
| C | C | B |
- 1
Track the open cells
Process the floor column by column with a mask of incoming occupied cells. - 2
Place a legal tile
Try every legal tile placement that covers the first uncovered cell without overlap or leaving the floor. - 3
Count completed floors
Sum ways reaching the final empty frontier modulo 1,000,000,007.
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.