{"problem":{"name":"E. Rikka with Data Structures","description":{"content":"As we know, Rikka is poor at data structures. Yuta is worrying about this situation, so he gives Rikka some tasks about data structures to practice. Here is one of them: Yuta has an array $A$ with $n","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":10000,"memory_limit":1048576},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10201E"},"statements":[{"statement_type":"Markdown","content":"As we know, Rikka is poor at data structures. Yuta is worrying about this situation, so he gives Rikka some tasks about data structures to practice. Here is one of them:\n\nYuta has an array $A$ with $n$ numbers, denoted by $A [ 1 ], A [ 2 ], \\\\\\\\cdots, A [ n ]$. Then he makes $m$ operations on it. \n\nThere are three types of operations:\n\nIt is too difficult for Rikka. Can you help her?\n\nThe input contains several test cases, and the first line contains a single integer $T$ ($1 <= T <= 200$), the number of test cases.\n\nFor each test case, the first line contains two integers $n$ ($1 <= n <= 10^5$) and $m$ ($1 <= m <= 10^5$).\n\nThe second line contains $n$ integers $A [ 1 ], A [ 2 ], \\\\\\\\cdots, A [ n ]$ ($1 <= A [ i ] <= 10^9$).\n\nThen $m$ lines follow, each line of which describes an operation, containing four integers as mentioned above, satisfying $1 <= l <= r <= n$, $1 <= k <= 10^9$ and $1 <= x <= n$.\n\nThe input guarantees that there are at most $10$ test cases with $n > 10^3$ or $m > 10^3$.\n\nFor each query, an operation of type $3$, output a single line with a single integer, the answer to this query.\n\n## Input\n\nThe input contains several test cases, and the first line contains a single integer $T$ ($1 <= T <= 200$), the number of test cases.For each test case, the first line contains two integers $n$ ($1 <= n <= 10^5$) and $m$ ($1 <= m <= 10^5$).The second line contains $n$ integers $A [ 1 ], A [ 2 ], \\\\\\\\cdots, A [ n ]$ ($1 <= A [ i ] <= 10^9$).Then $m$ lines follow, each line of which describes an operation, containing four integers as mentioned above, satisfying $1 <= l <= r <= n$, $1 <= k <= 10^9$ and $1 <= x <= n$.The input guarantees that there are at most $10$ test cases with $n > 10^3$ or $m > 10^3$.\n\n## Output\n\nFor each query, an operation of type $3$, output a single line with a single integer, the answer to this query.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case:  \n- Let $ n, m \\in \\mathbb{Z} $ denote the length of array $ A $ and number of operations.  \n- Let $ A = (A[1], A[2], \\dots, A[n]) $ be the initial array of integers.  \n- Let $ \\mathcal{O} = (O_1, O_2, \\dots, O_m) $ be a sequence of $ m $ operations, each of type $ 1 $, $ 2 $, or $ 3 $, specified by four integers:  \n\n**Operations**  \nFor each operation $ O_j $:  \n- **Type 1**: $ (1, l, r, k) $: For all $ i \\in [l, r] $, set $ A[i] \\gets A[i] + k $.  \n- **Type 2**: $ (2, l, r, k) $: For all $ i \\in [l, r] $, set $ A[i] \\gets k $.  \n- **Type 3**: $ (3, l, r, x) $: Query the number of indices $ i \\in [l, r] $ such that $ A[i] = x $.  \n\n**Constraints**  \n1. $ 1 \\le T \\le 200 $  \n2. For each test case:  \n   - $ 1 \\le n \\le 10^5 $, $ 1 \\le m \\le 10^5 $  \n   - $ 1 \\le A[i] \\le 10^9 $ for all $ i \\in \\{1, \\dots, n\\} $  \n   - For each operation: $ 1 \\le l \\le r \\le n $, $ 1 \\le k \\le 10^9 $, $ 1 \\le x \\le n $  \n3. At most 10 test cases have $ n > 10^3 $ or $ m > 10^3 $  \n\n**Objective**  \nFor each operation of type $ 3 $, output the count:  \n$$\n\\left| \\left\\{ i \\in [l, r] \\mid A[i] = x \\right\\} \\right|\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10201E","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}