Untitled conversation
- User
[04/10, 9:10 pm] Ámir: Codewriting
Problem Description
HISTORY
You are given an array arr consisting of N Integers. You are also given q queries. Each query consists of three integers x, y and z
RULES
For each query:
README
-
Find the largest contiguous subarray starting from index x, whose y th bit is set
-
Update each of its elements Bj with Bj A
SETTINGS
Where denotes the bitwise XOR operator
Your task is to print the total number of updates performed after q queries.
Given a 2D array mat that represents the queries:
• mat [i][0] = X
• mat[i][1] = Y
• mat[i][2] = Z
ⓘ
Problem Constraints [04/10, 9:11 pm] Ámir: mat[i][0] = x
mat[i][1] = Y
HISTORY
mat[i][2]=2
Problem Constraints
RULES
• 1≤ N ≤ 10^5
• Os arr[i]s 10^9
• 15XSN
0
15Y≤30
README
• OSZ≤ 10^9
• 15q≤ 10^5
SETTINGS
Input Format
• First argument is an integer array arr
• Second argument contains 2D integer array
mat.
Output Format
Return the number of updates performed after queries. [04/10, 9:18 pm] Ámir: arr = (2,4,3,5,4) mat [13, 1, 4], [2, 3, 7]]
main.cpp
1
HISTORY
Output 1:
4
RULES
Input 2:
0
README
arr = [1, 4] mat = [[2, 1, 3]]
SETTINGS
Output 2:
0
Explanation
Explanation 1:
1st Query (3, 1, 4):
• (3.5) is the largest subarray having the 1st-all
and starting with Index 3
-
- Assistant
- User
[04/10, 9:10 pm] Ámir: Codewriting
Problem Description
HISTORY
You are given an array arr consisting of N Integers. You are also given q queries. Each query consists of three integers x, y and z
RULES
For each query:
README
-
Find the largest contiguous subarray starting from index x, whose y th bit is set
-
Update each of its elements Bj with Bj A
SETTINGS
Where denotes the bitwise XOR operator
Your task is to print the total number of updates performed after q queries.
Given a 2D array mat that represents the queries:
• mat [i][0] = X
• mat[i][1] = Y
• mat[i][2] = Z
ⓘ
Problem Constraints [04/10, 9:11 pm] Ámir: mat[i][0] = x
mat[i][1] = Y
HISTORY
mat[i][2]=2
Problem Constraints
RULES
• 1≤ N ≤ 10^5
• O<= arr[i]<=10^9
• 1<=X<=N
1<=Y≤30
README
• OSZ≤ 10^9
• 15q≤ 10^5
SETTINGS
-
- Assistant
- User
[04/10, 9:10 pm] Ámir: Codewriting
Problem Description
HISTORY
You are given an array arr consisting of N Integers. You are also given q queries. Each query consists of three integers x, y and z
RULES
For each query:
README
-
Find the largest contiguous subarray starting from index x, whose y th bit is set
-
Update each of its elements Bj with Bj A
SETTINGS
Where denotes the bitwise XOR operator
Your task is to print the total number of updates performed after q queries.
Given a 2D array mat that represents the queries:
• mat [i][0] = X
• mat[i][1] = Y
• mat[i][2] = Z
ⓘ
Problem Constraints [04/10, 9:11 pm] Ámir: mat[i][0] = x
mat[i][1] = Y
HISTORY
mat[i][2]=2
Problem Constraints
RULES
• 1≤ N ≤ 10^5
• O<=arr[i]<= 10^9
• 1<=X<=N
0<=Z<=10^9
1<=Y≤30
• 1<=q≤ 10^5
Input Format
• First argument is an integer array arr
• Second argument contains 2D integer array
-
- Assistant