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

建议使用的浏览器:

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

3418:Quadratic Functions

题目描述

You are to process a sequence of M queries of two types:

  • Add a quadratic function f(x) = ax2 + bx + c into the plane.
  • Compute the global minimum value of all the quadratic functions at x: min{fi(x)}.

输入解释

The first line consists of one integer: M (number of queries). (2 ≤ M ≤ 106)
The next M lines contain queries. Each query can be either addition or computation.

  • I a b c : add a quadratic function into the plane. You can assume the coefficient of the linear term is the double of the quadratic term's.
  • Q x : compute the global minimum value of all the quadratic functions at x: min{fi(x)}. Before the query, there is at least a curve in the plane.

All numbers in the input file are integers, whose absolute values are no more than 106.

输出解释

For each computation query, print a line consisting of one integer which denotes the global minimum value. Assume the absolute values of the answers are no more than 2 × 109.

输入样例
2
I 1 2 1
Q 1
输出样例
4

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

源链接: POJ-3418

最后修改于 2020-10-29T07:01:04+00:00 由爬虫自动更新

共提交 0

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