QOJ.ac

QOJ

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

#22817. クロスワードの単語

Statistics

- が空白マス、# が黒いマスを表すクロスワードパズルを考えます。

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

通常のクロスワードと同様に、単語は少なくとも 2 つの連続したマスからなる必要があります。この例には横向きの単語が 5 個、縦向きの単語が 4 個あります。

クロスワードパズルを読み込み、横向きと縦向きの単語の個数を求めてください。

入力

最初の行には、正方形のパズルの一辺の長さを表す整数 $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.