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

Правка en2, от Riyuzak251097, 2018-06-22 23:13:22

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 not just getting an idea on how to link query(l) and query(r) in fenwick tree(BIT)

Теги #fenwick tree

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский Riyuzak251097 2018-06-22 23:14:53 0 (published)
en3 Английский Riyuzak251097 2018-06-22 23:13:47 8 Tiny change: '*\n\nI am not just getting ' -> '*\n\nI am just not getting '
en2 Английский Riyuzak251097 2018-06-22 23:13:22 12 (saved to drafts)
en1 Английский Riyuzak251097 2018-06-22 23:12:33 396 Initial revision (published)