Marks :20
: 3 | : 0
You are given an integer array $$$A$$$ containing $$$n$$$ integers. You need to answer $$$q$$$ queries of the following form:
The first line of input contains two space separated integers $$$n$$$ and $$$q$$$ $$$(1 \le n,q \le 10^5)$$$ — the number of elements in the array $$$A$$$ and the number of queries respectively.
The second line contains $$$n$$$ space separated integers $$$a_0, a_1, ... a_n$$$ $$$(1 \le a_i \le 10^9)$$$ — denoting the elements of the array $$$A$$$.
The next $$$q$$$ lines each contain three space separated integers $$$l$$$ $$$r$$$ $$$(1 \le l \le r \le n)$$$ and $$$x$$$ $$$(1 \le x \le 10^9)$$$ — denoting the queries.
Print the answer to each query in a single line.
5 2 1 2 2 3 5 1 5 2 2 4 1
2 3
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.