大白书 P50页

#include <algorithm>
#include <cstdio>
using namespace std;
const int maxn=;
int ma[maxn][maxn];
int Left[maxn][maxn],Right[maxn][maxn],up[maxn][maxn];
int main()
{
int cas;
scanf("%d",&cas);
while(cas--){
int n,m;
scanf("%d%d",&n,&m);
for(int i=; i<n; i++)
for(int j=; j<m; j++){
char ch =getchar();
while( ch != 'F' && ch != 'R' )ch=getchar();
ma[i][j]= ch == 'F' ? : ;
} int ans=;
for(int i=; i<n; i++){
int lo=-,ro=m;
for(int j=; j<m; j++)
if(ma[i][j]==){
Left[i][j]=up[i][j]=; lo=j;
}else{
up[i][j]=i==?:up[i-][j]+;
Left[i][j] = i == ?lo+:max( lo+, Left[i-][j] ); }
for(int j=m-; j>=; j--)
if(ma[i][j]==){
Right[i][j]=m;ro=j;
}else{
Right[i][j]=i==?ro-:min(ro-,Right[i-][j]);
ans=max(ans,up[i][j]*(Right[i][j]-Left[i][j]+));
} }
printf("%d\n",ans*);
}
return ;
}

最新文章

  1. Spring MVC学习笔记——给Controller和视图传值
  2. oracle中的case when then else end 用法
  3. setup 桌面化设置网卡
  4. Count the Trees[HDU1131]
  5. Apache服务器访问过慢分析及解决
  6. Saiku操作界面的简化
  7. Oracle 课程六之hint
  8. 利用 Composer 一步一步构建自己的 PHP 框架(一)——基础准备
  9. BZOJ 3240 矩阵游戏
  10. Swift - 时间控制器NSTimer(每隔一定时间执行某个函数)
  11. 谷歌下解决Pop遮罩层无法遮挡滚动栏下问题
  12. 表与表的关系把RD搞乱了,记一个Procedure中的bug
  13. bash shell快捷键[转]
  14. Tips and Tricks for Debugging in chrome
  15. [C]二级指针
  16. Codeforces Round #431 (Div. 2) B. Tell Your World
  17. EF迁移命令
  18. 2015年蓝桥杯省赛A组c++第8题(迭代法)
  19. git server side hook 试用
  20. Git--查看,删除,添加远程分支

热门文章

  1. eclipse使用maven打包时去掉测试类
  2. Shell输入输出重定向
  3. pandas常用
  4. EasyUI常用控件禁用方法
  5. poj3252Round Numbers【组合数】【数位dp】
  6. Mergeable Stack 直接list内置函数。(152 - The 18th Zhejiang University Programming Contest Sponsored by TuSimple)
  7. intptr_t、uintptr_t数据类型的解析
  8. javaweb使用 window.location.href 传中文参数 乱码问题
  9. LoadRunner-录制脚本中文显示乱码
  10. 杭电oj题目分类