SPOJ problem MATSUM, whats wrong in my code?

Please help me why my code produces WA for [MATSUM][1], my


[2]?


  [1]: http://www.spoj.com/problems/MATSUM/
  [2]: http://ideone.com/X7OXsO

Hereis your AC code.Your update and query functions are modified a little bit.I have added necessary comments where the changes have been made.You were not taking into account sum of some of the co-ordinates.

1 Like

Thank you for help. :slight_smile: