1843: 乘积最大子数组-Kadane算法

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

给你一个整数数组 nums ,请你找出数组中乘积最大的非空连续 子数组(该子数组中至少包含一个数字),并返回该子数组所对应的乘积。

任何子数组的乘积都 保证 是一个 32-位 整数

Input

输入一组数据

Output

输出最大乘积

Sample Input Copy

2 3 -2 4

Sample Output Copy

6