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

建议使用的浏览器:

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

6964:I love counting

题目描述
Mr W likes interval counting.

One day,Mr W constructed a sequence of length $n$, each position of this sequence has a weight $c$ ($c\leq n$).

There are a total of $Q$ queries, and each query is given an interval $(l, r)$ and two parameters $a$, $b$, and ask how many $\ kinds \ of \ weights\ $of this interval satisfy$\ \ c \bigoplus a \leq b\ \ $ where $\bigoplus$ is the binary Bitwise XOR operation.
输入解释
There is only one test case for this question.

In the first line contains a positive integer $n$ ($n \leq 100000$) represents the length of the sequence.

In the second line contains n positive integers, The i-th number in the sequence represents the weight $c_i$ ($1 \leq c_i \leq n$)of the i-th position.

In the third line, a positive integer $Q$ ($Q \leq 100000$) represents the number of queries.

In the next Q line, each line has four positive integers $l$, $r$, $a$, $b$ ($1 \leq l \leq r \leq n, a \leq n+1,b \leq n+1$), which represent the parameters of the query.
输出解释
For each query, output an integer on a line to represent the number of weights that meet the conditions.
输入样例
5
1 2 2 4 5
4
1 3 1 3
2 4 4 2
1 5 2 3
4 5 3 6
输出样例
2
1
2
1

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

源链接: HDU-6964

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

共提交 0

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