| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 67 | 31 | 25 | 54.348% |
Pentominous is a grid logic puzzle based on the twelve pentominoes. A pentomino is a polygon formed by connecting five equal-sized squares edge to edge.
Figure G.1: The twelve pentominoes (up to mirroring and rotations) and their names.
The goal of this puzzle is to divide a grid into regions of size 5ドル$ (that is, pentominoes), so that no two regions that share a side have the same shape. You are allowed to rotate and mirror the pentominoes, but such rotations and reflections count as the same shape. The twelve possible shapes can be seen in Figure \ref{fig:pentominoes}.
In a normal Pentominous puzzle, the player is given some pre-filled cells, for which the shape of their region is already predetermined. In this problem, you are working with a completely blank grid of dimensions $h\times w,ドル and your task is to create any valid arrangement of pentominoes.
The input consists of:
If there is no valid $h\times w$ Pentominous grid, output "no". Otherwise, output "yes", followed by $h$ lines of width $w$ each, a possible grid using the letters from Figure G.1. If there is more than one solution, any one of them will be accepted.
3 5
yes UUXUU UXXXU UUXUU
2 10
yes LLLLNNNPPP LIIIIINNPP
99 17
no
6 10
yes IPPYYYYVVV IPPXYLLLLV IPXXXFZZLV ITWXFFFZUU ITWWNNFZZU TTTWWNNNUU
1 5
yes IIIII