Type: Default 1000ms 256MiB

最大字段乘积

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

给定 n 个正数组成的一个序列,计算这个序列中所有子段中的乘积最大值。

例如,对于 (3, 0.1, 2, 0.1, 100),乘积最大的子段是 2×0.1×100=202 \times 0.1 \times 100=20。你需要写程序完成这个计算过程。

输入格式

第一行输入一个整数 n(1n100000)n(1 \le n \le 100000),表示一共有 n 个正数。

接下来一行 n 个正数(不一定是整数),表示读入的序列。

输出格式

输出一个小数,表示最大子段乘积,四舍五入保留两位小数。

输出时每行末尾的多余空格,不影响答案正确性

样例输入

5
3 0.2 20 0.1 100

样例输出

200.00

1月第三周昆十中教研

Not Claimed
Status
Done
Problem
13
Open Since
2026-3-16 0:00
Deadline
2026-3-30 23:59
Extension
24 hour(s)