Comments
On vasandani68Range Query Problem, 10 years ago
0

Auto comment: topic has been updated by vasandani68 (previous revision, new revision, compare).

On vasandani68Range Query Problem, 10 years ago
0

Auto comment: topic has been updated by vasandani68 (previous revision, new revision, compare).

On vasandani68Range Query Problem, 10 years ago
0

Auto comment: topic has been updated by vasandani68 (previous revision, new revision, compare).

Can u please explain ur add and del functions. How are u maintaining the result after ignoring all those indexes which have occured 2 times?

What if n>2?

Can you prove why gcd of every pair should be 1?

It is a naive approach and will time out.Please re-read the constraints and answer accordingly.

Auto comment: topic has been updated by vasandani68 (previous revision, new revision, compare).

can u explain in a bit naive way like what are active segments which u r taking about or actually what are the segments?

if we take an 'i' then the possible 'j' which we can take are i+a,i+a+1,i+a+2,....i+b with the condition that all elements between i and j must be greater or equal to v.

So what is the significance of sorting here and what are the segments which you are referring to?

Auto comment: topic has been updated by vasandani68 (previous revision, new revision, compare).

Auto comment: topic has been updated by vasandani68 (previous revision, new revision, compare).

Any idea how to do this?