题解 | #数组中子数组的最大累乘积#
数组中子数组的最大累乘积
http://www.nowcoder.com/practice/f46135ecf26a45b3b964239ebc745aac
n = int(input())
nums = list(map(float, input().split()))
bef_min = nums[0]
bef_max = nums[0]
res = nums[0]
for i in range(1, len(nums)):
bef_new_max = max(bef_min * nums[i], bef_max * nums[i], nums[i])
bef_new_min = min(bef_min * nums[i], bef_max * nums[i], nums[i])
res = max(res, bef_new_max)
bef_min = bef_new_min
bef_max = bef_new_max
print("%.2f" % res)