当前位置:网站首页>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
边栏推荐
- Detailed explanation of STP election (step + case)
- 16. Registration Center-consul
- Live Preview | KDD2022 Doctoral Dissertation Award Champion and Runner-up Dialogue
- Crawler text data cleaning
- Project development software directory structure specification
- [WeChat applet] This article takes you to understand data binding, event binding, event parameter transfer, and data synchronization
- 来自一位女测试工程师的内心独白...
- 直播预告 | KDD2022博士论文奖冠亚军对话
- keep-alive cache component
- Layer 2 broadcast storm (cause + judgment + solution)
猜你喜欢
"Cloud native's master, master and vulgar skills" - 2022 National New College Entrance Examination Volume I Composition
The comprehensive result of the case statement, do you know it?[Verilog Advanced Tutorial]
Drools WorkBench的简介与使用
Maximum monthly salary of 20K?The average salary is nearly 10,000... What is the experience of working in a Huawei subsidiary?
What have I experienced to become a tester who is harder than development?
12张图带你彻底搞懂服务限流、熔断、降级、雪崩
STM32CUBEMX develops GD32F303 (11) ---- ADC scans multiple channels in DMA mode
真正的CTO,是一个懂产品的技术人
What level of software testing does it take to get a 9K job?
基于FPGA的图像实时采集
随机推荐
Interprocess communication study notes
BAT卖不动「医疗云」:医院逃离、山头林立、行有行规
mysql 视图
CV-Model【3】:MobileNet v2
Arbitrum 专访 | L2 Summer, 脱颖而出的 Arbitrum 为开发者带来了什么?
221. Largest Square
What is the ideal college life?
f.grid_sample
[Map and Set] LeetCode & Niu Ke exercise
934. The Shortest Bridge
leetcode-1161: Maximum in-layer element sum
Teach you how to configure Jenkins automated email notifications
[WeChat applet] This article takes you to understand data binding, event binding, event parameter transfer, and data synchronization
BAT can't sell "Medical Cloud": Hospitals flee, mountains stand, and there are rules
Draw Your Cards
【AcWing 第62场周赛】
加密生活,Web3 项目合伙人的一天
The final exam first year course
MPPT太阳能充放电控制器数据采集-通过网关采集电池电压容量电量SOC,wifi传输
软件测试缺陷报告---定义,组成,缺陷的生命周期,缺陷跟踪产后处理流程,缺陷跟踪处理流程,缺陷跟踪的目的,缺陷管理工具