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

建议使用的浏览器:

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

6541:Neko and triangle

题目描述
Neko haves a sequence with $n$ points, the $i$-th point is $A_{i}$. And she gets $m$ key points.
Define the origin point is $O = (0,0)$.
For each key point $P_{k}$, you need to find a interval $[l, r]$ to make $\sum_{i = l} ^ {r} S_{i}$ max. $S_{i}$ is the directed area of triangle $\triangle OP_{k}A_{i}$. There may be a lot of intervals suitable, so you only need output the sum of area.
输入解释
The first line contains two integers $n, m(1 \leq n,m \leq 10^{5})$
The next $n$ line, each line contains two integers $x, y(0 \leq x,y \leq 10^{5})$, means the coordinate of the $i$-th point $A_{i}$.
The next $m$ line, each line contains two integers $x, y(0 \leq x,y \leq 10^{5})$, means the coordinate of the $i$-th key point $P_{i}$.
输出解释
For each key point, output the max area in one line. For convenience, please output twice the area.
输入样例
4 4
1 3
2 4
3 2
4 3
1 1
2 2
3 3
4 4
输出样例
4
8
12
16
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6541

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

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 524288/524288K(Java/Others)