shunfurh 于 2017.09.17 16:50 提问

Lattice Animals

Description

Lattice animal is a set of connected sites on a lattice. Lattice animals on a square lattice are especially popular subject of study and are also known as polyominoes. Polyomino is usually represented as a set of sidewise connected squares. Polyomino with n squares is called n-polyomino.
In this problem you are to find a number of distinct free n-polyominoes that fit into rectangle w*h. Free polyominoes can be rotated and flipped over, so that their rotations and mirror images are considered to be the same.
For example, there are 5 different pentominoes (5-polyominoes) that fit into 2*4 rectangle and 3 different octominoes (8-polyominoes) that fit into 3 * 3 rectangle.

Input

The input consists of a single line with 3 integer numbers n, w, and h (1 <= n <= 10, 1 <= w, h <= n).
Output

Write to the output a single integer number -- the number of distinct free n-polyominoes that fit into rectangle w * h.
Sample Input

5 5 5
Sample Output

12

1个回答

caozhy      2017.10.01 04:19

Uva 1602 Lattice Animals （网格动物）
The Solution Of Uva 1602 Lattice Animals （网格动物）题目地址UVa 原地址 VJudge题目大意给定一个 w * h 的 矩阵，在矩阵中找不同连通块的个数（旋转，翻转，平移算作一种）题目做法判重编码判重无疑是这道题的重点。那么从判重的方法来看，有两种方法： STL 的 set 手写 hash 从时间来看，set 所消耗的时间肯定更多，但是更加的方便。那么用
UVa1602 - Lattice Animals

UVa 1602 Lattice Animals
Lattice animal is a set of connected sites on a lattice. Lattice animals on a square lattice are especially popular subject of study and are also known as polyominoes. Polyomino is usually represent
Lattice Animals UVA - 1602

1602 - Lattice Animals
Lattice animal is a set of connectedsites on a lattice. Lattice animals on a square lattice are especially popularsubject of study and are also known as polyominoes. Polyomino is usuallyrepresented as
UVA 1062 Lattice Animals
P3870网格动物 时间限制 : - MS   空间限制 : 165536 KB 评测说明 : 3s 问题描述 网格动物是一种在网格中的联通块，由n个方块构成的联通块称为n连块。平移、旋转、翻转之后相同的算作同一种。例如，2*4里面的5连块有5种（第一行），3*3里的8连块有3种（第二行）。
Lattice Animals UVa1602

uva 1602 Lattice Animals

UVa 1602：Lattice Animals（BFS）

woj1005 - Holding Animals
Description The total available floor space on the ark would have been over 100,000 square feet, which would be more floor space than in 20 standard sized  basketball courts. But in our story, we