To update to a new value :
Find which block belongs to:
Update the block sum:
Update the array: That's it. One block update, one array update. Time: . Compare this to segment trees where updates take . For problems with many updates, sqrt decomposition has faster updates but slower queries. The tradeoff depends on your query-to-update ratio.