Type: Default 500ms 256MiB

数列分块入门 7

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

给出一个长为 nn 的数列,以及 nn 个操作,操作涉及区间乘法,区间加法,单点询问。

输入格式

第一行输入一个数字 nn

第二行输入 nn 个数字,第 ii 个数字为 aia_i,以空格隔开。

接下来输入 nn 行询问,每行输入四个数字 opt\mathrm{opt}llrrcc,以空格隔开。

opt=0\mathrm{opt} = 0,表示将位于 [l,r][l, r] 的之间的数字都加 cc

opt=1\mathrm{opt} = 1,表示将位于 [l,r][l, r] 的之间的数字都乘 cc

opt=2\mathrm{opt} = 2,表示询问 ara_r 的值 mod10007\mathop{\mathrm{mod}} 10007llcc 忽略)。

输出格式

对于每次询问,输出一行一个数字表示答案。

7
1 2 2 3 9 3 2
0 1 3 1
2 1 3 1
1 1 4 4
0 1 7 2
1 2 6 4
1 1 6 5
2 2 6 4
3
100

提示

对于 100% 100\% 的数据,$ 1 \leq n \leq 100000, -2^{31} \leq \mathrm{others}$、ans2311 \mathrm{ans} \leq 2^{31}-1

数列分块

Not Claimed
Status
Done
Problem
9
Open Since
2024-8-30 0:00
Deadline
2024-9-7 23:59
Extension
24 hour(s)