301740: CF330A. Cakeminator

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Cakeminator

题意翻译

## 题目描述 给你一个矩形蛋糕,表示为r×c网格。每个网格都可能有一个邪恶的草莓或者没有。例如,3×4蛋糕可能如下所示:【见图】 cakeminator将要吃蛋糕啦!每次他吃东西,他都会选择一个不含任何邪恶草莓的行或列,并且至少包含一个以前没有吃过的蛋糕,并吃掉那一行或列的所有蛋糕。他可能会吃多次。 请输出cakeminator可以吃的最大蛋糕数。 ## 输入输出格式 ### 输入格式: 第一行包含两个整数r和c(2 <= r,c <= 10 2 <= r,c <= 10 2 <= r,c <= 10),表示行数和列数蛋糕。下一行r每行包含c个字符 - 第i行的第j个字符表示第i行和第j行的单元格内容,并且是以下之一: ''字符表示没有邪恶草莓的蛋糕; 'S'字符表示带有邪恶草莓的蛋糕。 ### 输出格式: 输出蛋糕机可以吃的最大蛋糕数。

题目描述

You are given a rectangular cake, represented as an $ r×c $ grid. Each cell either has an evil strawberry, or is empty. For example, a $ 3×4 $ cake may look as follows: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF330A/c1d4207484b797e6588401fdab064288a9caa5dd.png)The cakeminator is going to eat the cake! Each time he eats, he chooses a row or a column that does not contain any evil strawberries and contains at least one cake cell that has not been eaten before, and eats all the cake cells there. He may decide to eat any number of times. Please output the maximum number of cake cells that the cakeminator can eat.

输入输出格式

输入格式


The first line contains two integers $ r $ and $ c $ ( $ 2<=r,c<=10 $ ), denoting the number of rows and the number of columns of the cake. The next $ r $ lines each contains $ c $ characters — the $ j $ -th character of the $ i $ -th line denotes the content of the cell at row $ i $ and column $ j $ , and is either one of these: - '.' character denotes a cake cell with no evil strawberry; - 'S' character denotes a cake cell with an evil strawberry.

输出格式


Output the maximum number of cake cells that the cakeminator can eat.

输入输出样例

输入样例 #1

3 4
S...
....
..S.

输出样例 #1

8

说明

For the first example, one possible way to eat the maximum number of cake cells is as follows (perform 3 eats). ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF330A/0035a5baa4607fda858367e26d648e7cd9060209.png) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF330A/80ef8e9dfce64ea540dd8ed8ccc87f198767a450.png) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF330A/5e46cc0b99dbddca73974f8f01c7991db48fc22e.png)

Input

题意翻译

## 题目描述 给你一个矩形蛋糕,表示为r×c网格。每个网格都可能有一个邪恶的草莓或者没有。例如,3×4蛋糕可能如下所示:【见图】 cakeminator将要吃蛋糕啦!每次他吃东西,他都会选择一个不含任何邪恶草莓的行或列,并且至少包含一个以前没有吃过的蛋糕,并吃掉那一行或列的所有蛋糕。他可能会吃多次。 请输出cakeminator可以吃的最大蛋糕数。 ## 输入输出格式 ### 输入格式: 第一行包含两个整数r和c(2 <= r,c <= 10 2 <= r,c <= 10 2 <= r,c <= 10),表示行数和列数蛋糕。下一行r每行包含c个字符 - 第i行的第j个字符表示第i行和第j行的单元格内容,并且是以下之一: ''字符表示没有邪恶草莓的蛋糕; 'S'字符表示带有邪恶草莓的蛋糕。 ### 输出格式: 输出蛋糕机可以吃的最大蛋糕数。

加入题单

上一题 下一题 算法标签: