Carpets

From programming_contest
Revision as of 06:19, 25 September 2018 by Kmk21 (talk | contribs) (Created page with "Even though it may seem too big (7 colors * 7 instances of each color), the problem is a brute force. Create a 2d array of each 1x1 square of the room. For the top-left most u...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Even though it may seem too big (7 colors * 7 instances of each color), the problem is a brute force. Create a 2d array of each 1x1 square of the room. For the top-left most uncovered square, iterate over all available carpet options in both orientations. If any of them fit, recurse.

It is difficult to prove this is fast enough, but it is the judge-provided correct solution. Similar to Stained Glass but without the ability to optimize using a bitmask.