## ICHB Selection Contest '17 Problem 3 - Parallel Universe

View as PDF

Points: 12 (partial)
Time limit: 1.2s
Memory limit: 64M

Author:
Problem type

You are locked in a parallel universe and for you to be able to escape you have to answer queries on an array named with elements. The queries are as follows:

• U x val - Change the value of to .
• Q x y val - Print . Here, refers to bitwise AND.

#### Constraints

There will be at most Q queries.

#### Input Specification

On the first line, you will find and .
On the second line, you will find numbers, where the number is .
On the next lines, you will find the queries.

#### Output Specification

For each Q type query, print each result on a different line.

#### Sample Input

3 3
5 7 15
Q 1 3 7
U 1 0
Q 1 3 15

#### Sample Output

5
0