Marks :10
: 0 | : 0
Anwar has an array $$$A$$$ consisting of $$$N$$$ integers on which he performs $$$M$$$ operations.
In the $$$j_{th}$$$ operation he will perform one of the following tasks:
$$$F(x)$$$ is defined as the largest power of 2 that divides x. For example, $$$F(4)=4, F(5)=1$$$.
Find the final values in $$$A$$$ after performing all operations. Since the answer may be very large return the elements of $$$A$$$ modulo $$$10^9+7$$$.
The first line of input consists of a single integer $$$n$$$ $$$(1 \leq n \leq 10^5)$$$ $$$-$$$ the total number of elements in the array $$$A$$$. The second line consists of $$$n$$$ space separated integers, the elements of the array $$$A$$$. The third line of input consists of a single integer $$$m$$$ $$$(0 \leq m \leq 10^5)$$$ $$$-$$$ the total number of queries. Each of the next $$$m$$$ lines consist of 3 space separated integers, which represent the queries. The format of each query is $$$type \; l \; r$$$, where $$$type$$$ denotes the type of the query and $$$l$$$ and $$$r$$$ denote the interval for the query.
The output should consist of $$$n$$$ space separated integers $$$-$$$ the final elements of the array $$$A$$$.
5 2 7 8 8 5 3 1 4 4 2 1 1 1 4 5
2 7 8 64 6
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.