Can someone give me an idea how to implement this question with a fenwick tree

Revision en4, by Riyuzak251097, 2018-06-22 23:14:53

Given an array of n integers (1<=n<=300000, 0<=arr[i]<=100000) and q queries (1<=q<=300000) where each query contains 2 integers l and r (1<=l<=r<=n), tell the gcd of all the elements in range l to r (both inclusive).

I am just not getting an idea on how to link query(l) and query(r) in fenwick tree(BIT)

Tags #fenwick tree

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Riyuzak251097 2018-06-22 23:14:53 0 (published)
en3 English Riyuzak251097 2018-06-22 23:13:47 8 Tiny change: '*\n\nI am not just getting ' -> '*\n\nI am just not getting '
en2 English Riyuzak251097 2018-06-22 23:13:22 12 (saved to drafts)
en1 English Riyuzak251097 2018-06-22 23:12:33 396 Initial revision (published)