Please give some online judge problems in which prefix sum( also known as cumulative sum) technique is useful.

Thanks in advance.

# | User | Rating |
---|---|---|

1 | tourist | 3565 |

2 | Benq | 3540 |

3 | Petr | 3519 |

4 | maroonrk | 3503 |

5 | jiangly | 3391 |

6 | ecnerwala | 3363 |

7 | Radewoosh | 3349 |

8 | scott_wu | 3313 |

9 | ainta | 3298 |

10 | boboniu | 3289 |

# | User | Contrib. |
---|---|---|

1 | 1-gon | 198 |

2 | Errichto | 196 |

3 | rng_58 | 191 |

4 | awoo | 186 |

5 | SecondThread | 185 |

6 | Um_nik | 182 |

7 | vovuh | 177 |

8 | Ashishgup | 176 |

9 | antontrygubO_o | 174 |

10 | -is-this-fft- | 173 |

Please give some online judge problems in which prefix sum( also known as cumulative sum) technique is useful.

Thanks in advance.

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Mar/06/2021 08:06:11 (h3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

Edit:Edit 2:thanks so much mr. Shinadul

He is Shahidul, not Shinadul lmao

How ignorant you are, if you can't even copy the name correctly

hush relaxxx it is just a name

do not take it to an argument, it's just a mistake, not smth that crushes the world. Take it easy!

A quite simple one: 816B — Karen and coffe

Easy problem of prefix sum https://codeforces.com/contest/1355/problem/C

Good One

This might help you while implementing`std::partial_sum( )`

296C Greg and Array

Also see this to practice range change in array per queries best solve through prefix sumhttps://www.hackerrank.com/contests/algoholic-contest-1/challenges/street-lights/problem

Constraints too large to use Prefix sum

Constraint for Ai1 ≤ Ai ≤ 10^9

Some DP + prefix sum : 479E - Riding in a Lift

PS : Sorry , but wasn't knowing that it's very old blog

Hey bro Old is GOLD ;)

;)

Problems sorted by difficulty.

Kuriyama Mirai's Stones

Vika and Squares

Balanced Tunnel

Karen and Coffee

Greg and Array

Valid Sets

Star Sky

Train Hard, Win Easy

Thank you for the difficulty order

Here is another easy one.

CF 363B — Fence

How can I solve "Vika and Squares" using prefix sum? I solved this problem using a constructive algorithm — 90242000

But want to solve it using prefix sum in order to learn it. Thank you.

me too wants to know how "vika and square" can be done with prefix sum?

Here are a couple of USACO problems:

http://www.usaco.org/index.php?page=viewproblem2&cpid=595

http://www.usaco.org/index.php?page=viewproblem2&cpid=104