use of BIT in HackerEarth problem

Revision en1, by abj, 2020-06-13 08:47:47

https://www.hackerearth.com/problem/algorithm/polynomial-queries-28458f8a/description/ is the link of the problem. It is a nice one from DSA June 2020 contest. Though I barely managed to land 5th in the contest, I felt disappointed on not being able to use BIT efficiently here. I know the solution for tighter limits on A[i] like 0<=A[i]<=10. Please help me.

Tags #segmenttree, #set

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English abj 2020-06-13 08:47:47 394 Initial revision (published)