QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 512 MB Points totaux : 50

#13490. Emacs

Statistiques

Daniel 在玩他最喜欢的文本编辑器时,决定画一幅高为 $N$ 个字符、宽为 $M$ 个字符的画。这幅画仅由字符 .* 组成,其中字符 * 构成了若干个互不重叠的矩形。这些矩形在边或角上甚至互不接触。

帮助 Daniel 统计画中绘制的矩形数量。

输入格式

第一行包含两个整数 $N$ 和 $M$ ($1 \le N, M \le 100$),含义如题面所述。

接下来的 $N$ 行,每行包含 $M$ 个字符 .*,表示 Daniel 画的画。

输出格式

输出一行一个整数,表示画中矩形的数量。

子任务

在价值 10 分的测试点中,所有矩形都将仅由单个 * 字符组成。

在另外价值 15 分的测试点中,满足 $N = 1$。

样例

输入样例 1

6 7
***....
***..**
.....**
.***.**
.***...
.***...

输出样例 1

3

输入样例 2

3 3
*.*
...
*.*

输出样例 2

4

输入样例 3

1 10
.*.**.***.

输出样例 3

3

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.