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

建议使用的浏览器:

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

6888:Art Class

题目描述
This class is on art. Mr. Picasso gives every baby a piece of white drawing paper and let them paint on it.

Baby Volcano is going to color the drawing paper black. For convenience, the drawing paper can be regarded as a Cartesian coordinate system, and initially, all points on it is white.

Baby Volcano plans to paint the drawing paper in $n$ steps. In the $i$th step, he will color rectangular $R_i$ black, where the lower left corner of $R_i$ is $(l_i,0)$, the upper right corner of $R_i$ is $(r_i,h_i)$.

Let $P_i$ be the drawing paper after the first $i$ steps, your task is to calculate the perimeter of black area on $P_i$.
输入解释
The first line contains a single integer $t(1 \leq t \leq 100)$, the number of testcases.

For each testcase, the first line contains a single integer $n(1 \leq n \leq 2 \times 10^5)$, the number of steps.

Then $n$ lines follow. Each line contains $3$ integers $l_i,r_i,h_i (1 \leq l_i, < r_i \leq 10^9, 1 \leq h_i \leq 10^9)$.

The input guarantees that there are no more than $3$ testcases with $n > 1000$.
输出解释
For each testcase, output $n$ lines. Each line contains a single integer, representing the perimeter of black area after the first $i$ steps.
输入样例
1
6
1 2 2
3 4 3
5 6 2
1 4 1
2 6 1
3 7 4
输出样例
6
14
20
20
20
22
来自杭电HDUOJ的附加信息
Recommend IceyWang

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

源链接: HDU-6888

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

共提交 2

通过率 50.0%
时间上限 内存上限
14000/7000MS(Java/Others) 524288/524288K(Java/Others)