QOJ.ac

QOJ

Time Limit: 6 s Memory Limit: 512 MB Total points: 100

#8949. 赫露艾斯塔

الإحصائيات

给定 $n$ 个点 $(x_i,y_i)_{i=1}^n$,你需要按顺序处理 $m$ 次操作。每次操作给出 $o,x,y,X,Y$,

  • 首先进行修改:
    • 若 $o=1$ 则将满足 $x_i\le x,\;y_i\le y$ 的点的 $y_i$ 修改为 $y$;
    • 若 $o=2$ 则将满足 $x_i\le x,\;y_i\le y$ 的点的 $x_i$ 修改为 $x$。
  • 然后进行查询,询问满足 $x_i\le X,\;y_i\le Y$ 的点数。

输入格式

第一行两个整数 $n,m$。

接下来 $n$ 行每行两个整数 $x_i,y_i$。

接下来 $m$ 行每行五个整数 $o,x,y,X,Y$,表示一次操作。

输出格式

共 $m$ 行,每行一个整数,依次表示每次操作进行的查询的答案。

样例数据

样例输入

5 6
1 2
3 1
5 1
3 5
4 4
1 4 2 5 4
1 4 3 5 3
2 3 5 1 3
2 2 3 1 4
1 3 3 1 4
2 5 5 2 1

样例输出

4
3
0
0
0
0

子任务

对于所有数据,$1 \le n,m \le 10^6$,$1\le x_i,y_i,x,y,X,Y\le n$。

子任务 1(10 分):$n,m\le 10^3$;

子任务 2(20 分):$x_i,y_i,x,y,X,Y$ 独立地在 $1$ 到 $n$ 内均匀随机选取;

子任务 3(20 分):$o=1$;

子任务 4(20 分):$n,m\le 3\times 10^5$,依赖子任务 1;

子任务 5(30 分):无特殊限制,依赖子任务 1、2、3、4。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.