Блог пользователя ncduy0303

Автор ncduy0303, история, 6 лет назад, По-английски

I created my own repository for CP purposes. I have tried to include as many commonly used algorithms and data structures as possible (some are taken from different sources).

Link: https://ncduy0303.github.io/Competitive-Programming/

Hope that somebody will find it useful and feel free to report any bugs :)

  • Проголосовать: нравится
  • +32
  • Проголосовать: не нравится

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Seems like quite a good starting point! Here are few suggestions. I won't write down what to add, because there are so many things to write in template and I don't know what you've intended to cover in your template. Hence these are only improvement suggestions. i.e, faster algorithm for a problem currently covered which are valid topics in CP, as far as I know.

  1. Maximum flow can be solved faster in Dinic's algorithm. I remember as $$$O(V^2 E)$$$ which is faster than Edmond-Karp. Unfortunately I do not recall a particular problem which is solvable by Dinic and not by E-K, but I am almost certain there are, since Dinic is actually faster than it looks in practice.

  2. I recommend studying $$$O(n^2 \log n)$$$ algorithm for 2D maximum sum subarray problem. I saw it twice, from ICPC Seoul Regional 2019 (I can't find this on CF Gym...) and Korean Olympiad. Here is a link to ICPC one, in Korean Online Judge. This can be done by segment tree + line sweeping technique.

  3. (I think you might know this) Precomputing factorials and using modulo inverse is usually cheaper for computing binomial coefficients

BTW, your codes look so much better than mine. Thanks for sharing :)