当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2830:Max Sequence II

Special Judge 特殊评判
题目描述

Given N real numbers a1, a2, …, aN, you are to write a program to calculate P as defined below.

P=\max_{1\leq i\leq j\leq N}\left\{\prod_{k=i}^ja_k\right\}
输入解释

The input consists of several test cases. Each test case consists of two lines:
Line 1: A single positive integer N ≤ 100,000.
Line 2: N real numbers a1, a2, …, aN (|ai| ≤ 30 for all i s.t. 1 ≤ iN) which are either integral or accurate to one digit after decimal point.
Process to the end of input.

输出解释

For each test case, output P in scientific notation in a single line. If P is equal to zero, output “0.000”. If 1 ≤ |P| < 10, output P directly with its fractional part rounded to three decimal places. In any other cases, output P in the format xEn where P = x × 10n (1 ≤ |x| < 10 and n is an integer). x should also be rounded to three digits after decimal point.

输入样例
5
-5.0 2.0 3.0 -2.0 0.5
3
-1 0 -1
输出样例
6.000E1
0.000
提示
Built-in floating-point types provided by the compilers may not hold P.

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2830

最后修改于 2020-10-27T21:25:00+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000 65536