当前位置:网站首页>Maximum area of solar panel od js
Maximum area of solar panel od js
2022-07-31 02:19:00 【Big chicken thighs are the best】
Title: Maximum area of solar panels | Time limit: 1 second | MemoryLimit: 32768K | Language Limit: Unlimited
To install a rectangular or square solar panel on one side of the spacecraft (the red slashed area in the picture), you need to install two pillars (black vertical bars in the picture) first, and then fix the solar panel in the middle part of the pillars.However, the length of the pillars at different positions of the spacecraft is different, and the installation area of the solar panel is limited by the length of the pillar on the shortest side.As shown:
Now provide a set of column height data in a shaped array. Assuming that the distance between each column is equal to 1 unit length, calculate how to select two columns to maximize the area of the solar panel.
Enter a description:
10,9,8,7,6,5,4,3,2,1
Note: There are at least 2 pillars and a maximum of 10000 pillars, and the supported height ranges from 1 to 10^9 integers.The heights of the pillars are unordered, and the decrease in the example is just a coincidence.
Output description:
Maximum solar panel area that can be supported: (between 10m high pillars and 5m high pillars)
25
Example 1
Enter
10,9,8,7,6,5,4,3,2,1
Output
25
Note:
The width between the 10-meter-high pillar and the 5-meter-high pillar is 5, and the height of the smaller pillar is also 5, and the area is 25.Take the other two
边栏推荐
- 汉源高科8路HDMI综合多业务高清视频光端机8路HDMI视频+8路双向音频+8路485数据+8路E1+32路电话+4路千兆物理隔离网络
- 验证整数输入
- PDF 拆分/合并
- Software testing basic interface testing - getting started with Jmeter, you should pay attention to these things
- Unity界面总体介绍
- VSCode Plugin: Nested Comments
- STM32CUBEMX开发GD32F303(11)----ADC在DMA模式下扫描多个通道
- BAT can't sell "Medical Cloud": Hospitals flee, mountains stand, and there are rules
- 软件测试缺陷报告---定义,组成,缺陷的生命周期,缺陷跟踪产后处理流程,缺陷跟踪处理流程,缺陷跟踪的目的,缺陷管理工具
- 【银行系列第一期】中国人民银行
猜你喜欢
GCC Rust is approved to be included in the mainline code base, or will meet you in GCC 13
rpm install postgresql12
FPGA-based vending machine
基于opencv实现人脸检测
STP选举(步骤+案列)详解
最高月薪20K?平均薪资近万...在华为子公司工作是什么体验?
【银行系列第一期】中国人民银行
Crypto Life, a day in the life of a Web3 project partner
Face detection based on opencv
12 pictures take you to fully understand service current limit, circuit breaker, downgrade, and avalanche
随机推荐
修改未正确放入沙盒造成苹果兼容性问题
图像处理技术的心酸史
STM32CUBEMX develops GD32F303 (11) ---- ADC scans multiple channels in DMA mode
Fiddler captures packets to simulate weak network environment testing
经典链表OJ强训题——快慢双指针高效解法
ShardingJDBC使用总结
To write good test cases, you must first learn test design
mmdetection trains a model related command
数学解决——环形链表问题
Coldfusion file read holes (CVE - 2010-2861)
Software Testing Defect Reporting - Definition, Composition, Defect Lifecycle, Defect Tracking Post-Production Process, Defect Tracking Process, Purpose of Defect Tracking, Defect Management Tools
keep-alive cache component
The PC side determines the type of browser currently in use
cudaMemcpy study notes
CV-Model [3]: MobileNet v2
pycharm cannot run after renaming (error: can't open file...No such file or directory)
【AcWing 62nd Weekly Game】
What does a software test report contain?
汉诺塔问题
Introduction and use of Drools WorkBench