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

建议使用的浏览器:

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

5283:Senior's Fish

题目描述
Xuejiejie loves to eat fish. One day, she goes to a pond for fishing. The pond can be seen as a two-dimensional surface, and her fishing net can be seen as a rectangle. One of the edges of the rectangle is parallel to the x-axis ,and another is parallel to y-axis. The fishes can be seen as points. Sometimes the fishes will enter the net, and sometimes they will leave the net. So, Xuejiejie doesn't know the appropriate time to draw the net in when she will get as many fishes as possible.

Xuejiejie assigns each fish with a number, from 1 to $n$, $n$ being the total number. There are 2 types of movements of the fishes:

1 l r d : the fishes index between the interval [l,r] moved towards the x-axis for length d (For example , if a fish's current position is $(x,y)$ , after moving , its position will change to $(x+d,y)$. )

2 l r d : the fishes index between the interval [l,r] moved towards the y-axis for length d (For example , if a fish's current position is $(x,y)$, after moving , its position will change to $(x,y+d)$. )

And sometimes Xuejiejie will ask you some questions.
输入解释
In the first line there is an integer $T$, indicates the number of test cases.

In each case:

The first line includes an integer $n$ indicating the total number of fish.

The second line includes 4 integers $x1$,$y1$,$x2$,$y2$,indicating the position of the fishing net. $(x1,y1)$ means the lower-left position, and $(x2,y2)$ means the top-right position.

The next n lines: each line includes $x[i],y[i]$; means the fish i's initial position.

The next line includes an integer $m$.

The next $m$ lines describe the events you have to deal with.

In each line the first integer is $c$ ($1\leq c\leq 3$), which indicates the type of events.

1 l r d : the fish index between the interval [l,r] moved towards the x-axis for length d

2 l r d : the fish index between the interval [l,r] moved towards the y-axis for length d

3 l r : query the number of the fish index between the interval [l,r] which are in the net(including the one in the border)

$1\leq n, m\leq 100000$, $1\leq l\leq r\leq n$. $1\leq d\leq 10^9$, $x1\leq x2$, $y1\leq y2$。 Ensure that any time all involved coordinate values in the range of$[-10^9,10^9]$。
输出解释
In each case:

For each type 3 events, output a integer which means the answer.
输入样例
1
5
1 1 5 5
1 1
2 2
3 3
4 4
5 5
3
3 1 5
1 2 4 2
3 1 5
输出样例
5
4
来自杭电HDUOJ的附加信息
Recommend hujie

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

源链接: HDU-5283

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

共提交 0

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