当前位置:网站首页>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
边栏推荐
- Unity界面总体介绍
- To write good test cases, you must first learn test design
- rpm install postgresql12
- Refuse to work overtime, a productivity tool set developed by programmers
- C language applet -- common classic practice questions
- 力扣刷题之有效的正方形(每日一题7/29)
- 系统需求多变如何设计
- CV-Model【3】:MobileNet v2
- Mathematical Ideas in AI
- MySQL stored procedure
猜你喜欢

"Cloud native's master, master and vulgar skills" - 2022 National New College Entrance Examination Volume I Composition

tcp框架需要解决的问题

ShardingJDBC usage summary

vlan间路由+静态路由+NAT(PAT+静态NAT)综合实验

The principle of complete replication of virtual machines (cloud computing)

What does a software test report contain?

STM32CUBEMX develops GD32F303 (11) ---- ADC scans multiple channels in DMA mode

User interaction + formatted output

Can an inexperienced college graduate switch to software testing?my real case

934. 最短的桥
随机推荐
The effective square of the test (one question of the day 7/29)
Layer 2 broadcast storm (cause + judgment + solution)
Live Preview | KDD2022 Doctoral Dissertation Award Champion and Runner-up Dialogue
1. Non-type template parameters 2. Specialization of templates 3. Explanation of inheritance
[1154] How to convert string to datetime
Unity界面总体介绍
Refuse to work overtime, a productivity tool set developed by programmers
Real-time image acquisition based on FPGA
There is a problem with the multiplayer-hlap package and the solution cannot be upgraded
【银行系列第一期】中国人民银行
LeetCode 1161 The largest element in the layer and the LeetCode road of [BFS binary tree] HERODING
STM32CUBEMX develops GD32F303 (11) ---- ADC scans multiple channels in DMA mode
GCC Rust is approved to be included in the mainline code base, or will meet you in GCC 13
ShardingJDBC基本介绍
Basic introduction to ShardingJDBC
leetcode-952: Calculate max component size by common factor
Hanyuan Hi-Tech 8-channel HDMI integrated multi-service high-definition video optical transceiver 8-channel HDMI video + 8-channel two-way audio + 8-channel 485 data + 8-channel E1 + 32-channel teleph
mysql 索引
How to design the changing system requirements
Detailed explanation of STP election (step + case)