QOJ.ac

QOJ

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

#7449. rgxsxrs

الإحصائيات

给定一个长为 $n$ 的序列 $a$,需要实现 $m$ 次操作:

1 l r x:表示将区间 $[l,r]$ 中所有 $>x$ 的元素减去 $x$。

2 l r:表示询问区间 $[l,r]$ 的和,最小值,最大值。

输入格式

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

第二行 $n$ 个正整数表示序列 $a$。

之后 $m$ 行每行 $3$ 或 $4$ 个正整数表示一次操作。

本题强制在线,所有输入的 $l,r,x$ 均需要异或 $lastans$,其定义为上一次询问操作得到的区间和对 $2^{20}$ 取模后的值,若之前没有询问操作,则为 $0$。

输出格式

对于每个操作 $2$ ,输出一行三个用空格分隔的数表示答案。

样例数据

样例输入

5 5
2 4 5 1 3
1 2 4 3
2 1 5
2 10 12
1 7 3 7
2 5 3

样例输出

9 1 3
6 1 3
4 1 2

子任务

Idea:wangziji&花花,Solution:wangziji&花花,Code:ccz181078,Data:wangziji&花花&ccz181078

注意:本题采用捆绑测试,只有当你通过一个 subtask 中的所有测试点后,你才能拿到这个 subtask 的分数。

对于 $1\%$ 的数据,$n,m\leq 1000$,时限为 3s。

对于另外 $14\%$ 的数据,$a_i\leq 10$,$n,m\leq 2\times10^5$,时限为 3s。

对于另外 $19\%$ 的数据,$a_i\leq 1000$,$n,m\leq 2\times10^5$,时限为 3s。

对于另外 $19\%$ 的数据,$a_i\leq 2\times 10^5$,$n,m\leq 2\times10^5$,时限为 3s。

对于 $100\%$ 的数据,$1\le n,m\leq 5\times 10^5$,$1\leq a_i,x\leq 10^9$。

Discussions

About Discussions

The discussion section is only for posting: Editorials, General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues. Submitting multiple issues may cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.