QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22817. 십자말풀이의 단어

Statistics

-가 빈 칸을, #가 검은 칸을 나타내는 십자말풀이를 생각하자.

----#
--##-
-----
-##--
#----

일반적인 십자말풀이처럼 단어는 적어도 두 개의 연속된 칸을 포함해야 한다. 이 예에는 가로 단어 다섯 개와 세로 단어 네 개가 있다.

십자말풀이를 입력받아 가로 단어와 세로 단어의 개수를 계산하라.

입력

첫 번째 줄에는 정사각형 퍼즐의 한 변의 길이인 정수 $N$ ($3\le N\le100$)이 주어진다. 다음 $N$개 줄에는 각각 - 또는 #인 문자 $N$개가 주어진다.

출력

가로 단어의 개수와 세로 단어의 개수를 이 순서대로 출력하라.

예제

입력 1

5
----#
--##-
-----
-##--
#----

출력 1

5
4

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.