Ominous Omino: Difference between revisions

From programming_contest
Jump to navigation Jump to search
imported>Plg5
No edit summary
imported>Plg5
No edit summary
Line 12: Line 12:
==X is 1==
==X is 1==
The grid can always be filled by 1x1 blocks, no matter the grid size
The grid can always be filled by 1x1 blocks, no matter the grid size
==X is 2==
If R * C is an even number, then it always can be filled
==X is 3==
Here there are two possible ominos, an L shape and an I shape. The min(R, C) must be >= 2 to fit the L omino, and the max(R, C) >= 3 to fit the I omino. Also, R * C must again be a multiple of 3

Revision as of 02:02, 25 April 2015

Introduction

https://code.google.com/codejam/contest/6224486/dashboard#s=p3

The problem asks if you can fit an Omino of X blocks into an R by C grid perfectly.

An omino is a "tetris-like" shape of blocks. You must determine if every type of X omino can be made to fit, using any combination of other X ominos

Solution

I'm not smart enough to tell you how to actually solve this problem. However, for the "small" case, the solutions can just be hardcoded. The small case limits X, R, and C to a max of 4.

X is 1

The grid can always be filled by 1x1 blocks, no matter the grid size

X is 2

If R * C is an even number, then it always can be filled

X is 3

Here there are two possible ominos, an L shape and an I shape. The min(R, C) must be >= 2 to fit the L omino, and the max(R, C) >= 3 to fit the I omino. Also, R * C must again be a multiple of 3