QOJ.ac

QOJ

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

#11062. TEST_69

الإحصائيات

给定一个长为 $n$ 的序列 $a$,有 $m$ 次操作。

每次有两种操作:

1 l r x:对于区间 $[l,r]$ 内所有 $i$,将 $a_i$ 变成 $\gcd(a_i,x)$。

2 l r:查询区间 $[l,r]$ 的和,答案对 $2^{32}$ 取模后输出。

输入格式

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

第二行 $n$ 个数表示 $a_i$。

之后 $m$ 行,每行三个或四个数,表示一次操作。

输出格式

对每个 $2$ 操作,输出一行一个数表示这次查询的答案。

样例数据

样例 1 输入

10 10
4 1 5 10 1 3 8 2 8 2 
2 1 7
2 1 10
1 7 10 4
1 5 8 10
2 1 8
1 3 5 2
1 3 4 3
2 5 8
2 3 7
2 6 10

样例 1 输出

32
44
26
6
6
11

子任务

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

对于 $20\%$ 的数据,满足 $1 \le n,m,a_i,x \le 10^3$。

对于 $50\%$ 的数据,满足 $1 \le n,m \le 10^5$,且 $a$ 中的元素与每次操作的 $x$ 均随机生成。

对于另外 $20\%$ 的数据,满足所有的查询均在修改后发生。

对于 $100\%$ 的数据,满足 $1\le n\le 2\cdot 10^5,1\le m\le 5 \cdot 10^5$,所有数值为 $[1,10^{18}]$ 内的整数。

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.