i'm stuck on this problem
http://lightoj.com:81/volume/problem/1187
forum says there is an O(n) greedy and an nlog(n) solution with BIT/segtree .can you give any hint or idea so i can get closer to solve this.
i'm stuck on this problem
http://lightoj.com:81/volume/problem/1187
forum says there is an O(n) greedy and an nlog(n) solution with BIT/segtree .can you give any hint or idea so i can get closer to solve this.
this is the problem link ...... http://lightoj.com:81/volume/problem/1097 it can be solved using bit but how does it fit into the complexity ??