포럼
문제 ICPC00333

C. Cangaroo

설명

Let us talk about the big elephant in the roomYou also wanted an elephant but this did not fit with the kangaroo in your room, sadly.: you've had a kangaroo in your room for a while now and you need to hide it without raising suspicion, since you want to keep the animal. Hiding an animal of this size is difficult: if you use a lot of space, it is obvious that you are hiding something from your friends. Hence, you want to use as little space as possible to hide the kangaroo.

When the kangaroo was placed against the wall, you took a black and white picture of the animal. Looking around in the house, the only tools you found to hide the kangaroo with were empty tin cans. The dimensions of the tin cans correspond with \(2 \times 2\) pixels in the picture and these cans cannot overlap. So, you can make a cangaroo and if someone asks why you have cans in the shape of a kangaroo, you simply say it is a bad joke of yours.

The position of each can has to exactly correspond to a block of \(2\times 2\) pixels in the picture, and they cannot be shifted or rotated to only partially cover some pixels. Furthermore, cans cannot float in the air, so every can has to be supported either by the floor, which is just below the bottom row of the picture, or by another can, for which at least one of the left and right half must directly rest on another can. The structure does not otherwise need to be balanced.

What is the minimum number of cans needed to hide the kangaroo?

제약
입력 형식

The input consists of:
- One line containing two integers \(n\) (\(2\leq n\leq 100\)) and \(m\) (\(2\leq m\leq 10\)), the height and width of your room. Both \(n\) and \(m\) are even.
- \(n\) lines, each containing \(m\) characters that are either '.' or '#', where '#' marks a position that needs to be hidden by a can.

출력 형식

Output the minimal number of \(2 \times 2\) cans that is required to hide the kangaroo in the room.

예제 1
입력
4 4
....
..#.
.##.
##..
출력
3
예제 2
입력
4 4
#.#.
....
#...
....
출력
4
예제 3
입력
14 8
........
....##..
...###..
....##..
.....#..
...####.
..#####.
.######.
.#####..
.###....
.##.....
..##....
...#....
.###....
출력
15
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC BAPC 2021

평가 및 의견

C. Cangaroo

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

C. Cangaroo

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8