March Easy problem:

Revision en1, by kabirsahni8, 2017-03-02 00:56:48

Given an array how to find sum of all f(A',k) where A' is subarray of A and f(A',k) are total unordered pairs (i,j) such that abs(A[i]−A[j])>=k.How to solve this using segment tree.What should be the merge function?

Tags segment tree, hackerearth

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English kabirsahni8 2017-03-02 01:04:55 229
en1 English kabirsahni8 2017-03-02 00:56:48 236 Initial revision (published)