当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7116:Lowbit

题目描述
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:


  • $\texttt{1 L R}$, add $lowbit(a_i)$ to each $a_i$ in the interval $[L, R]$.

  • $\texttt{2 L R}$, query the sum of the numbers in the interval $[L, R]$.


$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.
输入解释
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.
输出解释
For each query, output a line contains the answer modulo $998244353$.
输入样例
1
5
1 2 3 4 5
5
2 2 4
1 1 3
2 2 4
1 1 5
2 4 5
输出样例
9
12
14

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7116

最后修改于 2021-10-23T19:11:34+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
12000/6000MS(Java/Others) 262144/262144K(Java/Others)