比赛 |
ZLXSCDay2 |
评测结果 |
AAAAAAAAAAAAA |
题目名称 |
哞哞城堡 |
最终得分 |
100 |
用户昵称 |
Zayin |
运行时间 |
0.136 s |
代码语言 |
C++ |
内存使用 |
1.30 MiB |
提交时间 |
2016-04-10 16:54:18 |
显示代码纯文本
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define maxn 505
using namespace std;
int n,m;
int sum[maxn],high[maxn][maxn];
char map[maxn][maxn];
void init()
{
scanf("%d%d",&n,&m);
for (int i=1;i<=n;++i)
scanf("%s",map[i]+1);
/*for (int i=1;i<=n;++i)
{
for (int j=1;j<=m;++j)
cout<<map[i][j];
cout<<endl;
}*/
}
void solve()
{
int ans=0;
for (int k=1;k<=n;++k)
{
for (int j=1;j<=m;++j)
{
sum[j]=sum[j-1]+(map[k][j]=='.');
for (int i=1;i<=j;++i)
{
if (high[i][j])
{
if (map[k][i]=='.'&&map[k][j]=='.')
high[i][j]+=1;
else
high[i][j]=0;
}
if (sum[j]-sum[i-1]==j-i+1)
{
if (high[i][j]==0)
high[i][j]=1;
ans=max(ans,high[i][j]*(j-i+1));
}
}
}
}
cout<<ans<<endl;
}
int main()
{
freopen("fortmoo.in","r",stdin);
freopen("fortmoo.out","w",stdout);
init();
solve();
return 0;
}