Stupid question on Fenwick Tree

Revision en1, by Indiot, 2024-01-17 14:58:09

Hi~

To be able to get the hell out of this grey color, i'm learning new data structures. One of those is Fenwick Tree. By copying code of others on the internet, i'm now able to perform some basic operations such as min / max/ sum on a specific interval. Now here come a new problem, how to find the maximum X * f(X) on range [0, r], f(X) here denotes the occurrences of X within that interval. Thank you all, I much appreciate it!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Indiot 2024-01-17 14:58:09 466 Initial revision (published)