//Accepted 5196 KB 109 ms //类似hdu1506 //输入数据的格式没有明确的限制 //可能出现以下情况 //5 5 //R //F //F F F //F F F F F //R R R //R R //R F R F R //R R R R R #include <cstdio> #include <cstring> #include <iostream> using namespace std; ; bool map[imax_n][im…
the main algorithm as the 1506 #include <stdio.h> #include <iostream> #include <string> using namespace std; ][]; ][]; int m,n; int find(int a){ int i,j,res,max; int t; ],r[]; l[]=; r[m]=m; ;i<=m;++i){ t=i; ){ l[i]=i; continue; } &…
题意: 给出一个像这样的矩阵 R F F F F F F F F F F F R R R F F F F F F F F F F F F F F F 求F组成的最大子矩阵(面积最大) 有多组数据 优秀的暴力??? 思路:枚举每个点 然后这个点可以往上延伸到最上的点 这两点为一根线 这根线左移移到最左可以到的地方 右边也是如此 然后算出面积 需要预处理出每个点往左延伸的最远点与往右延伸的最远点 code #include<iostream> #include<cstdio>…