QOJ.ac

QOJ

Time Limit: 3.5 s Memory Limit: 64 MB Total points: 100

#11269. 魔法少女网站

الإحصائيات

雨谷小雨给你一个长为 $n$ 的序列,定义区间 $[l,r]$ 的子区间为所有形如 $[l',r']$ 的区间,满足 $l',r'$ 为整数,且 $l \le l' \le r' \le r$。

有 $m$ 次操作:

1 x y:将 $x$ 位置的值修改为 $y$。

2 l r x:查询区间 $[l,r]$ 中有多少子区间的最大值小于或等于 $x$。

输入格式

第一行有两个整数 $n,m$,第二行有 $n$ 个整数表示这个序列。

接下来 $m$ 行,每行形如 1 x y 或者 2 l r x 表示每次操作。

输出格式

对于每个 $2$ 操作,输出一行一个数表示答案。

样例数据

样例输入

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

样例输出

1
1
7
0

子任务

Idea:nzhtl1477,Solution:nzhtl1477,Code:ccz181078,Data:ccz181078

对于 $100\%$ 的数据,$n,m \le 3 \times 10^5$,$1 \le l \le r \le n$,$1 \le x, y \le n$,序列中每个元素都在 $[1,n]$ 中,所有数均为整数。

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.