Logo
(追記) (追記ここまで)

32483번 - Geometric Gridlock 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB67312554.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:

  • One line with two integers $h$ and $w$ (1ドル \le h,w \le 100$), the height and width of the grid.

출력

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.

제한

예제 입력 1

3 5

예제 출력 1

yes
UUXUU
UXXXU
UUXUU

예제 입력 2

2 10

예제 출력 2

yes
LLLLNNNPPP
LIIIIINNPP

예제 입력 3

99 17

예제 출력 3

no

예제 입력 4

6 10

예제 출력 4

yes
IPPYYYYVVV
IPPXYLLLLV
IPXXXFZZLV
ITWXFFFZUU
ITWWNNFZZU
TTTWWNNNUU

예제 입력 5

1 5

예제 출력 5

yes
IIIII

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > German Collegiate Programming Contest > GCPC 2024 G번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /