This post is only for newbies. A very common trick with Cumulative Sum + BIT is discussed with some examples and problems. Here is the link Thanks for reading.

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

1 | tourist | 3778 |

2 | Benq | 3592 |

3 | ecnerwala | 3521 |

4 | Um_nik | 3423 |

5 | jiangly | 3375 |

6 | Petr | 3342 |

7 | Radewoosh | 3337 |

8 | scott_wu | 3313 |

9 | maroonrk | 3265 |

10 | yosupo | 3259 |

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

1 | Errichto | 201 |

2 | 1-gon | 200 |

3 | rng_58 | 194 |

4 | SecondThread | 193 |

5 | awoo | 186 |

6 | vovuh | 183 |

7 | Um_nik | 182 |

8 | antontrygubO_o | 177 |

9 | Ashishgup | 175 |

10 | -is-this-fft- | 171 |

This post is only for newbies. A very common trick with Cumulative Sum + BIT is discussed with some examples and problems. Here is the link Thanks for reading.

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jan/23/2021 01:02:48 (f1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

Can u give some related problems...?

You don't actually need ones. Just remember the idea how to count the number of elements in a multiset that lie between

`l`

and`r`

. When you'll encounter this subproblem, use the algorithm that was explained here.I mean that IMHO it's not a good idea to look for a problem, for which you know in advance using what algorithm you'll solve it (exception: the case when you need to practise quick coding of a standard algorithm).

https://codeforces.com/contest/474/problem/D

I think this one is similar https://atcoder.jp/contests/abc107/tasks/arc101_b

Well written.