P7983 [JRKSJ R3] practiceZ
题目背景

题目描述
琴琴给了你两个长为 $n$ 的序列 $a,b$,请你支持三种操作共 $m$ 次:
1. `1 l r x`,将 $a$ 序列的区间 $[l,r]$ 中的所有数修改为 $x$。
2. `2 l r y`,将 $b$ 序列的区间 $[l,r]$ 中的所有数修改为 $y$。
3. `3 l r`,求 $\sum_{i=l}^r \sum_{j=1}^{b_i} a_j$。答案对 $2^{32}$ 取模。
输入格式
无
输出格式
无
说明/提示
**本题采用捆绑测试。**
注:原时间限制为 5s,较为卡常所以被管理改为 7s。
| $\text{Subtask}$ | $n\le$ | $m\le$ | 特殊性质 | 分值 | 子任务依赖 | 时间限制 |
| :----------: | :----------: | :----------: | :----------: | :----------: | :----------: | :----------: |
| $1$ | $500$ | $10^3$ | 无 | $10$ | 无 | $2\text{s}$ |
| $2$ | $10^4$ | $10^4$ | 无 | $10$ | $1$ | $2\text{s}$ |
| $3$ | $10^5$ | $10^5$ | 无 | $30$ | $1,2$ | $4\text{s}$ |
| $4$ | $5\times 10^5$ | $3\times 10^5$ |数据随机 | $20$ | 无 | $5\text{s}$ |
| $5$ | $5\times 10^5$ | $3\times 10^5$ | 无 | $30$ | $1,2,3,4$ | $5\text{s}$ |
对于 $100\%$ 的数据,$1\le n\le 5\times 10^5$,$1\le m\le 3\times 10^5$,$1\le a_i,x\le 10^9$,$1\le b_i,y\le n$。