Upload
kenny-park
View
96
Download
2
Embed Size (px)
Citation preview
타일
채우
기 4
13
04
5 박
현민
INTR
ODUCTION
CH
AP
TE
R 1
[949] 타일 채우기 4
[342D] Xenia and Dominoes
IDEA
CH
AP
TE
R 2
Codeforces Round #199 (Div. 2) Editorial
In the problem you can count number of correct puzzles or substract number of incorrect puzzles from number of all puzzles. In any case you should count DP, where the state is (j, mask) — j — number of the last full column, mask — mask of the last column. This problem is equivalent to the well known problem about domino tiling or the problem about parquet.
To get the solution of the whole problem I did the following. I try to at-tach one domino to each of 4 directions, then paint all three cells in black and count the number of correct puzzles. But in this case you will count some solutions several number of times. So you need to use inclusion exclusion formula for these 4 directions.
O 가 최대 1 개이므로 간단한 포함배제를 사용한다
( 움직이는 것을 고려하지 않은 전체 경우의 수 )
-
( 움직일 수 있는 타일이 하나도 없는 경우의 수 )
REALIZAT
ION
CH
AP
TE
R 3
BIT DYNAMICAL BACKTRACKING
고급 교재 199~214 쪽 참고
BIT INDEX
1
2
4
CASE 0
- -
- -
- -
- -
|
|
|
|
- -
CASE 1
X
- -
- -
X
|
|
CASE 2
- -
X
- -
CASE 3
X
X
- -
CASE 4
- -
- -
X
|
|
X
CASE 5
X
- -
X
CASE 6
- -
X
X
CASE 7
X
X
X
그림을 추가하려면 아이콘을 클릭하십시오
감사
합니
다
이 프
리젠
테이
션은
http://
slides
hare.
net/5
25hm/1
50205-4
에서
다시
보실
수 있
습니
다