Hrbust 2326 Blind Father(思维)

Picture of ssh key 立即下载
Blind Father
Time Limit: 1000 MSMemory Limit: 512000 K
Total Submit: 103(44 users)Total Accepted: 54(42 users)Rating: Special Judge: No
Description

Mr. Leng, who is the predominately inheritor of buried-love family  (One of the most vogue families during your primary school maybe, anyway, this is unimportant), has such cool, cooler and coolest temperament. But, only a good ACMer can be the real leader, in other words, be admitted as a successor.

One day, a problem come to Mr. Leng 's father about carpentry. There are N pieces of planks upright the ground in one line. Each one width 1 and height uncertain.  His father wants to cut some of them and then get a rectangle. How the biggest rectangle does him can make? It too difficult to his father to solve the problem, but it is really easy for Mr. Leng. So do you. Please surmount the problem as soon as you can.

Ps: You can't move or change the posture or position of any planks.

Input

There are multiple cases. In each cases, the first line only contains an integer N, 

means the number of the planks. And the second line contains N numbers, means the height of  N planks one by one.

1<=N<=10000



Output
Please output the biggest rectangle that Mr. Leng 's father can get.
Sample Input
3
10 6 10
Sample Output
18
Hint
样例图形
Source
"尚学堂杯"哈尔滨理工大学第七届程序设计竞赛

题意:有n个宽为1的矩形并排放置,求其最大子矩形面积。

思路:枚举每一个小矩形,向两边找第一个比它短的矩形,复杂度是O(n^2),但这题数据较水,也是可以过的。

PS:正解貌似使用单调栈做。。


#include<bits/stdc++.h>
using namespace std;
const int N = 10000 + 10 ;
int main()
{
    int n;
    int a[N];
    while(scanf("%d",&n)==1)
    {
        int maxi=-1;
        for(int i=1;i<=n;i++)
        {
            scanf("%d",&a[i]);
        }
        for(int i=1,j,k;i<=n;i++)
        {
            for(j=i;j<=n;j++)
                if(a[j]<a[i])
                    break;
            for(k=i;k>0;k--)
                if(a[k]<a[i])
                    break;
            //printf("%d %d\n",j,k);
            maxi=max(maxi,(j-k-1)*a[i]);
        }
        printf("%d\n",maxi);
    }
}








政府科技管理者如何提升区域科技成果转化项目的评价与筛选效率?.docx 科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。 立即下载

相关推荐

高校技术转移办公室人员在成果转化过程中如何快速提升技术推介效率?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

HRBUST 2326 Blind Father 【思维】

Blind Father Time Limit: 1000 MSMemory Limit: 512000 KTotal Submit: 147(59 users)Total Accepted: 73(56 users)Rating:Special Judge: NoDescriptionMr. Leng, who is the predominately inheritor of buried-l...

Emiya丶的博客 310

两相交错并联Boost电路仿真模型(Simulink仿真实现)

内容概要:本文档系统性地介绍了基于Simulink平台的两相交错并联Boost电路仿真模型,属于电力电子变换器建模与仿真研究的重要组成部分。该模型采用交错并联结构,有效提升了系统效率、降低了输出电流纹波,并具备优良的动态响应与系统稳定性。文档不仅聚焦于该特定拓扑的开环与闭环控制实现,还整合了丰富的配套资源,涵盖多种主流DC-DC变换器(如Buck、Boost、LLC、CLLC)、功率因数校正(PFC)电路、PWM整流器、双向充放电系统以及新能源应用场景(如V2G、微电网)等领域的仿真模型。资源体系强调软开关技术、多相交错控制、系统级建模与参数优化设计,所有内容均提供可运行的Simulink仿真文件,部分包含详细的设计报告、计算书及参考文献,具有较强的工程实践与科研复现价值。; 适合人群:电气工程、自动化、电力电子与电力传动等相关专业的硕士博士研究生、高校科研人员,以及从事新能源发电、电动汽车、电源系统设计等领域的工程技术人员。; 使用场景及目标:①支撑高校电力电子与电力系统方向的科研项目,用于新型拓扑结构的建模与先进控制算法的验证;②服务于本科生与研究生的毕业设计、课程设计及高水平学术论文的仿真复现;③为企业在电源产品研发、新能源系统集成等环节提供成熟的仿真方案参考,缩短研发周期,降低试错成本。; 阅读建议:建议使用者首先访问文档末尾提供的完整资源目录链接,按需下载对应仿真模型;在实践过程中,应重点关注模型的参数配置、控制策略实现细节与仿真工况设置,结合配套的说明文档深入理解其工作原理与设计思路,推荐在MATLAB/Simulink环境中动手调试与二次开发,以充分掌握电力电子系统的核心技术。

CF#877 B. Nikita and string(思维,暴力)

B. Nikita and string time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day Nikita found the string contai

xiaotuji的博客 1242

USB PD Sink HUSB238A可应用于24V电动风扇/电动工具

HUSB238A在I2C模式下,可申请PD3.1 EPR AVS功率,可申请24V电压直接给电机供电

Hynetek的博客 759

Claude Code启动失败解决方案,执行文件不兼容一键修复

Claude Code命令行工具突然报错,显示"不支持的16位应用程序"。作者排查Node版本无果后,发现是Anthropic更新导致Windows兼容性问题。解决方法很简单:卸载旧版、切换npm镜像源、重装最新版即可恢复。经验教训:遇到类似问题应先搜索社区反馈,避免无谓排查,同时注意npm源使用后及时还原。整个踩坑过程虽折腾,但最终只是简单的重装问题。

1457

CF#798 B. Mike and strings(思维)

B. Mike and strings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike has n strings s1, s2, ..., sn each

xiaotuji的博客 1108

浅谈python反序列化漏洞

0x01 python序列化与反序列化 Python 的序列化和反序列化是将一个类对象向字节流转化从而进行存储和传输,然后使用的时候再将字节流转化回原始的对象的一个过程。python中的序列化操作是通过pickle模块,而该模块主要包含l dumps将dict转化为str格式,loads将str格式转化为dict格式。 dump和load与文件操作结合起来, pickle.dump(obj, f...

Lethe's Blog 3220

CF#798 C. Mike and gcd problem(思维)

C. Mike and gcd problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike has a sequence A = [a1, a2, ..

xiaotuji的博客 947

PCIE Lane Margining Linux 环境配置

Copy all the provided files in folder PYC38 or PYC310 to the created pcie_lmt folder. Index of /ftp/python/3.8.10/Copy below commands to a file and rename it as "scan_pcie.py", the commands are from "685662 PCIe-LMT-Gen4_Gen5-r0p77.pdf" in the lane margi

mysongshine的博客 1436

2 利用ITK实现多帧Dicom读取,VTK实现数据显示

vtk中也有dicom读写类,但是只能完成单帧DICOM数据读取,这对于实际应用是非常不利的。而ITK可以实现dicom多帧读取,通常情况ITK与VTK也会结合使用(ITK处理,VTK显示),所以就一起学习下吧!

buerbuhuitou的博客 1564

CSU 1009 抛硬币(贪心)

1009: 抛硬币 Submit Page     Summary    Time Limit: 1 Sec     Memory Limit: 128 Mb     Submitted: 1104     Solved: 346     Description James得到了一堆有趣的硬币,于是决定用这些硬币跟朋友们玩个小游戏。在一个N行M列的表格上,每一个

xiaotuji的博客 870

TLSv1.0与TLSv1.1安全漏洞深度解析与实战修复指南

本文深度解析TLSv1.0与TLSv1.1的安全漏洞,包括POODLE和BEAST攻击原理,并提供实战修复指南。通过禁用老旧协议、配置安全加密套件和网络层防护措施,有效提升系统安全性。文章还针对无法立即升级的场景,给出了补偿性防御方案,帮助管理员全面应对传输层安全风险。

weixin_29322855的博客 206

CF#660 C. Hard Process(尺取法)

C. Hard Process time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given an array a with n elements.

xiaotuji的博客 747

OpenCV学习笔记(25)基于MFC和OpenCV的摄像机定标与立体匹配测试程序(20140505更新)

最近整理了一下这两年一直在用的摄像机定标与立体匹配测试程序,将代码进行了重构,界面也做了调整,分享出来方便有需要的朋友使用。当然我的编程能力有限,程序可能还有各种bug,请大家多多包涵。相关问题欢迎留言或email联系讨论,谢谢! ==================================================================================源码

晨宇思远 5万+

AI自瞄原理剖析(一)屏幕内容循环截取及代码实现

尽管Yolo框架在推理时其实是可以输入不同大小的图片的,但这些作者大多不会去处理图像尺寸的改变,所以目前大部分开源源码主要是以输入320或者640尺寸的图像为主。只要截图的效率足够快,能够满足一秒采集60张图片,也就是稳定的截图速度达到60帧以上,那么就可以实现内存级别的AI锁死自瞄效果。这里强调了截图速度对于最终实现特定自瞄效果的重要性,只有达到这样的速度标准,才能让整个自瞄相关的功能在内存层面有效地运作起来。在实现自瞄功能的情境下,只需要以游戏准星为中心向外的正方形区域图像就够了,没必要进行全屏截取。

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 1096

2016福州大学第十三届程序设计竞赛 Problem C 平行四边形数(思维)

Problem C 平行四边形数 Accept: 82    Submit: 425 Time Limit: 2000 mSec    Memory Limit : 32768 KB  Problem Description 在一个平面内给定n个点,任意三个点不在同一条直线上,用这些点可以构成多少个平行四边形?一个点可以同时属于多个平行四边形。  Input 多

xiaotuji的博客 728

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

CF#764 D. Timofey and rectangles(四色定理)

D. Timofey and rectangles time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One of Timofey's birthday present

xiaotuji的博客 681

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

ZOJ 3212 K-Nice(思维)

K-Nice Time Limit: 1 Second      Memory Limit: 32768 KB      Special Judge This is a super simple problem. The description is simple, the solution is simple. If you believe so, just read it on.

xiaotuji的博客 620

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

HRBUST 1789 通信道路(思维)

通信道路 Time Limit: 1000 MS Memory Limit: 32768 K Total Submit: 36(25 users) Total Accepted: 20(19 users) Rating:  Special Judge: No Description      某

xiaotuji的博客 615

CF#803 B. Distances to Zero(水题)

B. Distances to Zero time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given the array of integer num

xiaotuji的博客 614

CF#804 B. Minimum number of steps(字符串,思维)

D. Minimum number of steps time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We have a string of letters 'a' a

xiaotuji的博客 585

CF#348 A. Mafia(二分,思维)

A. Mafia time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day n friends gathered together to play "Mafia

xiaotuji的博客 583

CF#354 A. Vasya and Robot(思维题)

A. Vasya and Robot time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has n items lying in a line. The it

xiaotuji的博客 552

HDU 2089 不要62(暴力)

不要62 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 41302    Accepted Submission(s): 15047 Problem Description 杭州人称那些傻乎乎粘嗒嗒的人为62(音

xiaotuji的博客 551

CF#712 C. Memory and De-Evolution(水题)

C. Memory and De-Evolution time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Memory is now interested in the

xiaotuji的博客 509
上一篇: HDU 5249 KPI(STL,set和queue的运用)
下一篇: Hrbust 2327 Collection Game(思维)
信鸦
博客等级 码龄10年 10粉丝 133原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值