Home => ProblemSet => 2.12-46:位运算
Problem1833--2.12-46:位运算

1833: 2.12-46:位运算

Time Limit: 1 Sec  Memory Limit: 128 MB  Submit: 0  Solved: 0
[ Submit ] [ Status ] [ Creator: ][ 参考程序 ]

Description

Input

第一行,两个正整数 n,q。
接下来一行有 n 个自然数,表示序列 a。
接下来 q 行,每行一次询问 op,l,k。

Output

共 q 行,每行一个自然数表示答案。

Sample Input Copy

3 3
3 2 4
0 1 1
0 2 2
1 3 2

Sample Output Copy

1
0
2

HINT

对于 20% 的数据,保证 1≤n,q≤1000。
对于另 20% 的数据,保证 0≤ai,k≤1000。
对于另 10% 的数据,保证 op=0。
对于另 10% 的数据,保证 op=1。
对于 100% 的数据,保证 1≤n,q≤105,1≤l≤n,op∈{0,1},0≤ai,k≤109

Source/Category