City Game(最大子矩阵)】的更多相关文章

Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees,factories and buildings. There is still some space in the area that is u…
Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees, factories and buildings. There is still some space in the area that is…
小故事: A * "1+1+1+1+1+1+1+1 =?" * A : "上面等式的值是多少" B : *计算* "8!" A *在上面等式的左边写上 "1+" * A : "此时等式的值为多少" B : *quickly* "9!" A : "你怎么这么快就知道答案了" A : "只要在8的基础上加1就行了" A : "所以你不用重新计…
题目 https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1030 题意 矩阵,有障碍和普通地面两种子元素,求普通地面连成的子矩阵面积最大值 * 3 思路 如刘书 对于子矩阵长方形来说,其底边上必然有一点,该点向上可以延伸的距离就是子矩阵的长,枚举这一点,设为(i,j).(i,j)不是障碍是普通地面. 令up[i][j]为其向上能…
最大01子矩阵和,就是一个矩阵的元素不是0就是1,然后求最大的子矩阵,子矩阵里的元素都是相同的. 这个题目,三个oj有不同的要求,hoj的要求是5s,poj是3秒,hdu是1秒.不同的要求就对应不同的难度,不同的逼格. 先看最low的, HOJ 1664 5秒钟的时间,够长了.我很容易想到可以最大子矩阵和来求解,二者本来就很像,关于最大子矩阵和这个博客里有介绍 最大子矩阵和 这里我们可以把F变成1,把R变成负无穷大,这样求解最大子矩阵和就可以得到答案 #include <iostream> #…
题意:多组数据(国外题好像都这样),每次n*m矩形,F表示空地,R表示障碍 求最大子矩阵(悬线法模板) 把每个格子向上延伸的空格看做一条悬线 以le[i][j],re[i][j],up[i][j]分别记录该悬线向左,向右的运动极限以及向上的延伸长度 ans=max(ans,(up[i][j]*(re[i][j]-le[i][j]+1))); #include<cstdio> #include<iostream> #include<cstring> #include<…
F - City Game Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Bob is a strategy game programming specialist. In his new city building game the gaming environmentis as follows: a city is built up by areas, in which there are str…
最大子矩阵(City Game, SEERC 2004, LA 3029) 给定一个m×n的矩阵,其中一些格子是空地(F),其他是障碍(R).找出一个全部由F组成的面积最大的子矩阵,输出其面积乘以3后的结果. [输入格式] 输入的第一行为数据组数T.每组数据的第一行为整数m和n(1≤m,n≤1 000):以下m行每行n个字符(保证为F或者R),即输入矩阵. [输出格式] 对于每组数据,输出面积最大的.全由F组成的矩阵的面积乘以3后的结果. Sample Input 2 5 6 R F F F F…
City Game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6140    Accepted Submission(s): 2618 Problem Description Bob is a strategy game programming specialist. In his new city building game th…
        我们考虑一个$N\times M$的矩阵数据,若要对矩阵中的部分数据进行读取,比如求某个$a\times b$的子矩阵的元素和,通常我们可以想到$O(ab)$的遍历那个子矩阵,对它的各个元素进行求和.然而当$a$或$b$很大的时候,这样的计算显得太慢,如果要求子矩阵的最大元素和(如Ural 1146),更是简直慢到不能忍.         于是就想,能不能在读入数据的同时,我就先进行一些预处理,使得到后面进行计算的时候,可以简化一些步骤呢?答案是可以的.        我们开一个…