RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00658

Pahuljice

Unrated 레이팅 미적용
난이도
1s
시간 제한
512MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

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?

제약

Subtask 1 (11 points): There won’t be any snowlake, or the largest snowflake will be of size 1.

Subtask 2 (11 points): There will be at most one character ’+’ in the drawing.

Subtask 3 (28 points): No additional constraints.

입력 형식

The first line contains two integers \(n\) and \(m\) (\(1 \le n\), \(m \le 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.

서브태스크
서브태스크점수설명

1

11점

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

2

11점

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

3

28점

No additional constraints.

예제 1
입력
5 6
\.\|/.
---+--
/./|\.
./.|.\
/..|..
출력
1
예제 2
입력
7 7
\.|./..
.\|/...
--+--..
./|\...
/.|.\|/
....-+-
..../|\
출력
2
예제 3
입력
7 7
\|/|\|/
-+-|-+-
/|\|/|\
---+---
\|/|\|/
-+-|-+-
/|\|/|\
출력
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.

문제 정보

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

출처 COCI 2023/2024 Contest 2

평가 및 의견

Pahuljice

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

Log in to rate problems.

개별 의견

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

풀이 제출

Pahuljice

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