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

建议使用的浏览器:

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

5461:Largest Point

题目描述
Given the sequence $A$ with $n$ integers $t_1,t_2,\cdots,t_n$. Given the integral coefficients $a$ and $b$. The fact that select two elements $t_i$ and $t_j$ of $A$ and $i\neq j$ to maximize the value of $a t_i^2 + b t_j$, becomes the largest point.
输入解释
An positive integer $T$, indicating there are $T$ test cases.
For each test case, the first line contains three integers corresponding to $n~(2\le n\le 5\times 10^6),~a~(0\le |a|\le 10^6)$ and $b~(0\le |b|\le 10^6)$. The second line contains $n$ integers $t_1,t_2,\cdots,t_n$ where $0\le |t_i|\le 10^6$ for $1\le i\le n$.

The sum of $n$ for all cases would not be larger than $5 \times 10^6$.
输出解释
The output contains exactly $T$ lines.
For each test case, you should output the maximum value of $a t_i^2 + b t_j$.
输入样例
2

3 2 1
1 2 3

5 -1 0
-3 -3 0 3 3
输出样例
Case #1: 20
Case #2: 0
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5461

最后修改于 2020-10-25T23:22:52+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1500/1000MS(Java/Others) 65535/32768K(Java/Others)