当前位置: 首页 > news >正文

盐城网站开发公司电话wordpress自定义登录界面

盐城网站开发公司电话,wordpress自定义登录界面,温州seo代运营,图书翻页的动画 做网站启动用感觉动态规划都是玄妙的很#xff0c;思维题吧#xff08;单调栈思维#xff09; 题解#xff1a;让求最大矩形面积#xff0c;宽为1#xff0c;暴力超时 可以发现 当第i-1个比第i个高的时候 比第i-1个高的所有也一定比第i个高 于是可以用到动态规划的思想 令l…感觉动态规划都是玄妙的很思维题吧单调栈思维 题解让求最大矩形面积宽为1暴力超时 可以发现   当第i-1个比第i个高的时候   比第i-1个高的所有也一定比第i个高   于是可以用到动态规划的思想 令left[i]表示包括i在内比i高的连续序列中最左边一个的编号   right[i] 为最右边一个的编号 那么有   当 h[left[i]-1]h[i]]时   left[i]left[left[i]-1]  从前往后可以递推出left[i]    同理      当 h[right[i]1]h[i]]时   right[i]right[right[i]1]   从后往前可递推出righ[i] 最后答案就等于  max((right[i]-left[i]1)*h[i]) 了 A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows the histogram that consists of rectangles with the heights 2, 1, 4, 5, 1, 3, 3, measured in units where 1 is the width of the rectangles:   Usually, histograms are used to represent discrete distributions, e.g., the frequencies of characters in texts. Note that the order of the rectangles, i.e., their heights, is important. Calculate the area of the largest rectangle in a histogram that is aligned at the common base line, too. The figure on the right shows the largest aligned rectangle for the depicted histogram. Input The input contains several test cases. Each test case describes a histogram and starts with an integer n, denoting the number of rectangles it is composed of. You may assume that 1 n 100000. Then follow n integers h1, ..., hn, where 0 hi 1000000000. These numbers denote the heights of the rectangles of the histogram in left-to-right order. The width of each rectangle is 1. A zero follows the input for the last test case. Output For each test case output on a single line the area of the largest rectangle in the specified histogram. Remember that this rectangle must be aligned at the common base line. Sample Input 7 2 1 4 5 1 3 3 4 1000 1000 1000 1000 0 Sample Output 8 4000 /*题目题意:题目给了n个矩形的高度问最大连续矩形的公共面积底乘以这段连续矩形中 最短的高度)每个矩形的底是1 题目分析:我们可以枚举每一个矩形把它当作最矮的矩形剩下就差知道底了。 既然这个矩形是最矮的的那一个那么它左边的矩形和右边的矩形的高度应该大于等于它*/ #includeiostream #includestdio.h #includecstring #includecmath #define ll long long using namespace std; const int maxn1e51000; ll a[maxn],Left[maxn],Right[maxn]; int main() {int n;while (~scanf(%d,n)n){for(int i1; in; i)scanf(%lld,a[i]);Left[1]1;Right[n]n;for (int i2; in; i) ///求出每个矩形左端非递减连续的下标{int ti;while (t1a[i]a[t-1])/**状态转移*/tLeft[t-1];Left[i]t;}for (int in-1; i1; i--) ///求出每个矩形右端非递减连续的下标{int ti;while (tna[i]a[t1])tRight[t1];Right[i]t;}ll ans0;for (int i1; in; i)ansmax(ans,(Right[i]-Left[i]1)*a[i]);printf(%lld\n,ans);}return 0; }
http://www.zqtcl.cn/news/903712/

相关文章:

  • 政务公开网站建设的亮点和建议wordpress注册怎么设置密码
  • 外贸有哪些网站成都网络营销搜索推广优势
  • 国外mod大型网站财税公司
  • 一个很好的个人网站开发做一个简单网页多少钱
  • 东莞在哪里学网站建设网站建设团队与分工
  • 网站功能插件昆明网站建设技术研发中心
  • 网站开发培训中心 市桥移动端ui
  • 高碑店地区网站建设上海排名十大装潢公司
  • 无锡自助建站网站还是新能源专业好
  • pc 手机网站 微站如何建设与维护网站
  • 大学生兼职网站开发毕设论文杭州网络排名优化
  • 做教育机器网站网站建设的步骤图
  • 桔子建站是什么平台郑州公司注册网上核名
  • 网站开发技能有哪些网站建设艾金手指科杰
  • 网站建设挂什么费用网站建设学那些课
  • 网站定位与功能分析在互联网公司做网站
  • 安阳网站建设兼职做网站推广有哪些公司
  • 网站制作的一般过程怎么用手机搭建网站
  • 备案 网站名称 怎么改深圳建网站公司
  • html 企业网站模板网站策划书免费
  • 网站建设销售ppt拖拽建站系统源码
  • 网站托管费用多少网站的开发流程
  • 周到的商城网站建设北京品牌网站
  • 网站开发费用属于什么科目网站建设考试多选题
  • c asp做网站wordpress4.5.2文章采集
  • 百度网站建设电话建立网站站建设可以吗
  • 网站后台代码在哪修改网站如何做下一页
  • 网站开发职业要求百度推广代理商与总公司的区别
  • 西安网站建设中心网页 网 址网站区别
  • 技术支持东莞网站建设机械seo岗位是什么意思