Boshkash_Hates_CP's blog

By Boshkash_Hates_CP, history, 6 weeks ago, In English

Hello , Recently i was trying to solve this problem 932B which was kinda tricky as it requires prefix sum to avoid TLE , it required 2d-prefix sum , so what's that and why i could need it , suggest some problems to get familiar with it.

»
6 weeks ago, # |
  Vote: I like it +13 Vote: I do not like it

$$$p_{i,j}:=\sum_{x\le i,y\le j}a_{x,y}$$$

and

$$$p_{i,j}=p_{i-1,j}+p_{i,j-1}-p_{i-1,j-1}$$$