QOJ.ac

QOJ

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

#11283. Frühlingsbeginn

统计

给定 $n,m$,你需要维护一个 $[1,n)$ 的数轴上区间的初始为空的可重集合,支持三种操作共 $m$ 次:

  1. 插入一个区间 $[l,r)$。
  2. 删除第 $t$ 次操作插入的区间。
  3. 给出一个区间 $[l,r)$,判断当前可重集合是否存在一个子集,使得子集中所有区间的并恰好是 $[l,r)$。

输入格式

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

下面 $m$ 行,每行若干个整数描述一次操作,可能是 1 l r2 t3 l r

输出格式

对于每个询问,输出一行一个大写字母 YNY 表示存在这样的子集,N 反之。

样例数据

样例 1 输入

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

样例 1 输出

Y
N

样例 2 输入

9 17
1 6 9
1 1 8
1 5 7
1 6 8
1 8 9
3 4 5
3 1 7
3 8 9
1 4 9
3 1 8
3 1 7
1 6 9
3 2 6
2 2
1 1 3
3 1 2
1 4 6

样例 2 输出

N
N
Y
Y
N
N
N

子任务

Idea:critnos,Solution:critnos,Code:fjy666,Data:critnos

所有数据保证 $2\le n\le 10^6$,$1\le m\le 5\times 10^5$,$1\le l < r\le n$。所有操作 $2$ 对应的 $t$ 都是此前的操作 $1$ 且所有 $t$ 互不相同。

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.