report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Maximum product - MarisaOJ: Marisa Online Judge

Maximum product

Time limit: 1000 ms
Memory limit: 256 MB
You are given an array $A$ of length $n$. Find the maximum value of $a_i \times a_j$ and $i < j$. ### Input - The first line contains an integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print a single integer which is maximum value possible. ### Constraints - $2 \le n \le 10^3$. - $|A_i| \le 1000 $. ### Example Input: ``` 4 -2 -10 3 4 ``` Output: ``` 20 ```
Array
Even elements
Smallest value
Average
Array reversal
Negative and positive
Consecutive differences
Largest value
Positive and negative
Dominant element
Second largest
Maximum product
Array rotation
Palindrome array
Circle
Insert
Positive subarray
Sorting
Similar Arrays
Unique
Unique 2
Frequent value
Most Frequent Value
Bitonic sequence
Swap
Topic
Basic
Rating 800
Solution (0) Solution