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

30939번 - Pahuljice 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB55504591.837%

문제

Lana likes to draw specific snowflakes. A snowflake of size $x$ is defined as follows:

  • The center of the snowflake is the character '+'.
  • Above and below the character '+' there is a sequence of $x$ characters '|'.
  • To the left and right of the character '+' there is a sequence of $x$ characters '-'.
  • On the diagonal from the upper left corner to the center and from the center to the lower right corner of the snowflake there is a sequence of $x$ characters '\'.
  • On the diagonal from the upper right corner to the center and from the center to the lower left corner of the snowflake there is a sequence of $x$ characters '/'.

Sometimes Lana connects several snowflakes, but even then the size of each snowflake is determined separately, regardless of whether the snowflakes share some characters.

\|/
-+-
/|\
\.|./..
.\|/...
--+--..
./|\...
/.|.\|/
....-+-
..../|\
\.|./.
.\|/..
--+---
./|\..
/...\.

On the left is an example of a snowflake of size 1ドル$.

In the middle is an example of connected snowflakes, the left one of size 2ドル$ and the right one of size 1ドル$.

On the right is an example of a snowflake of size 1ドル$. It is missing one character '|' to be of size 2ドル$.

Lana is currently drawing snowflakes on a piece of paper of size $n \times m$. However, she got a bit confused and did not draw all the snowflakes completely in accordance with her usual snowflake shapes. Namely, some snowflakes are missing some characters, so their size is equal to the smallest length of the corresponding character sequence from the center in one of the eight directions. Moreover, she drew some characters that are not part of any snowflake.

Can you help Lana determine the size of the largest snowflake in the drawing?

입력

The first line contains two integers $n$ and $m$ (1ドル ≤ n, m ≤ 50$), the size of the drawing.

In each of the following $n$ lines there are $m$ characters describing the drawing.

The characters that can appear in the drawing are '+', '-', '\', '|', '/' and '.'. The ASCII values of these characters are 43, 45, 92, 124, 47 and 46 respectively.

출력

In the first and only line you should output the size of the largest snowflake in the drawing.

제한

서브태스크

번호배점제한
111

There won’t be any snowlake, or the largest snowflake will be of size 1ドル$.

211

There will be at most one character '+' in the drawing.

328

No additional constraints.

예제 입력 1

5 6
\.\|/.
---+--
/./|\.
./.|.\
/..|..

예제 출력 1

1

예제 입력 2

7 7
\.|./..
.\|/...
--+--..
./|\...
/.|.\|/
....-+-
..../|\

예제 출력 2

2

예제 입력 3

7 7
\|/|\|/
-+-|-+-
/|\|/|\
---+---
\|/|\|/
-+-|-+-
/|\|/|\

예제 출력 3

1

힌트

Clarification of the first example:

Only one snowflake is drawn.

In the directions up-left, up and up-right from the center of the snowflake there are sequences of length 1ドル$.

In the directions right and down-right from the center of the snowflake there are sequences of length 2ドル$.

In the directions left, down-left and down from the center of the snowflake there are sequences of length 3ドル$.

Therefore, the size of the snowflake is 1ドル$.

Clarification of the second example:

Two connected snowflakes are drawn, the left one of size 2ドル$ and the right one of size 1ドル$.

출처

Contest > Croatian Open Competition in Informatics > COCI 2023/2024 > Contest #2 1번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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