I am trying to solve this problem in UVA with Binary Indexed Tree:
Problem H Ahoy, Pirates! Input: Standard Input Output: Standard Output In the ancient pirate
A BIT can be operated in one of 3 modes:
I've explained range updates with BIT and provided implementation here: http://kartikkukreja.wordpress.com/2013/12/02/range-updates-with-bit-fenwick-tree/