Type: Default 500ms 256MiB

数列分块入门 8

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 个操作,操作涉及区间询问等于一个数 cc 的元素,并将这个区间的所有元素改为 cc

输入格式

第一行输入一个数字 nn

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

接下来输入 nn 行询问,每行输入三个数字 llrrcc,以空格隔开。

表示先查询位于 [l,r][l,r] 的数字有多少个是 cc,再把位于 [l,r][l,r] 的数字都改为 cc

输出格式

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

4
1 2 2 4
1 3 1
1 4 4
1 2 2
1 4 2
1
1
0
2

提示

对于 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)