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

28228번 - Parking Party 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB108484254.545%

문제

Peyman has decided to host a dinner party in his house at Zabol. His house has a rectangular parking lot which can be represented by a grid with n rows and m columns. A car can park in one of the n × m cells in this grid. However, some cells are occupied by immovable pillars and thus, no car can park in or pass through them. Each row or column in the parking lot has an entrance on both its ends. When a car enters the parking lot through an entrance, it can just move forward straightly in the corresponding row or column; it stops and parks in a grid cell when it reaches the opposite entrance or when the next cell is occupied by a pillar or another parked car. Additionally, a car cannot enter a row or column if its first cell is already occupied.

Peyman wants to maximize the number of cars that can be parked in his parking lot. In order to do that, he can instruct the guests on which entrance to take upon arrival. Your task is to help Peyman achieve this task.

입력

The first line of input contains two space-separated integers n and m (1 ⩽ n, m ⩽ 1000), the number of rows and columns in the parking lot, respectively. Each of the following n lines contain a string of length m made of “.” and “o” characters. the j-th character of the (i + 1)-th line is an “o” if the cell in row i and column j contains a pillar, and it is a “.” if it is empty.

출력

Print a single integer k, the maximum number of cars Peyman can park in his parking lot.

제한

예제 입력 1

3 3
.o.
o.o
.o.

예제 출력 1

4

예제 입력 2

3 4
oooo
....
...o

예제 출력 2

7

힌트

출처

ICPC > Regionals > Asia West Continent > Iran > 2022 ICPC Asia Tehran Regional Contest E번

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

출처

대학교 대회

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

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