-->
当前位置:首页 > 题库 > 正文内容

PROGRAMMING:Get the candy

Luz3年前 (2021-05-10)题库315
Long long ago,a handsome boy whose name is HSP studied in JSU of information science and engineering. He is clever and always thinks of ways to make fun of others. Now,it is your turn.
HSP and his girlfriend ZM come to the store. There are n candies in the store. The labels are 1, 2, 3... N, and the corresponding values are W1, W2, W3... Wn. Now, HSP takes a candy labeled a first, and the candy labeled less than a is taken back by ZM. Then HSP can only choose a candy labeled B from the rest candy. What is the maximum value of Wa WB?
###Input format:
Multiple groups of data input, the first line of each group of data input a number n (2 < = n < = 100000), the next N lines, each line input a wi to represent the value of the ith candy
(0###Output format:
The maximum value of Wa WB for each group of data output
###Input example:
```in
three
3 2 1
six
1 1 1 1 1 1
```
###Output example:
```out
two
0
```
JSU 2015 ACM Working Group


answer:If there is no answer, please comment

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。