|
||||||||||
LowbitTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1298 Accepted Submission(s): 295 Problem Description Lucida has a sequence of $n$ integers $a_1, a_2, \dots, a_n$. He asks you to perform two types of operations for him, which are described as follows:
$lowbit(x)$ is defined as the largest power of 2 that divides $x$. For example, lowbit(4)=4, lowbit(5)=1. Specially, lowbit(0)=0. Lucida wants you to give the answer modulo $998244353$ for each of his queries. Input This problem contains multiple test cases. The first line contains a single integer $T$ ($1\leq T \leq 20$) indicating the number of test cases. For each case, the first line contains an integer $n$ ($1 \leq n \leq 10^5$), the length of the sequence. The next line contains $n$ integers $a_i$ ($1 \leq a_i < 998244353$) separated by spaces, representing the sequence. The next line contains an integer $m$ ($1 \leq m \leq 10^5$), the number of operations. The next $m$ lines, each line contains 3 integers $op, L, R$ ($1 \leq op \leq 2$, $1 \leq L \leq R \leq n$), represents one operation. The specific meaning is described above. Output For each query, output a line contains the answer modulo $998244353$. Sample Input
Sample Output
Source | ||||||||||
|