Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

AlwaysACoder's blog

By AlwaysACoder, history, 4 years ago, In English

Could anyone give a link, to repository which has best snippets in terms of efficiency and are easy to read. Snippets which are more general are appreciable (like multipurpose segtree).

Thanks!

  • Vote: I like it
  • +29
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it
»
4 years ago, # |
  Vote: I like it +8 Vote: I do not like it
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

If you want efficiency (and not readability): sort the submissions on yosupo's judge based on time. Be warned that sometimes the codes are beyond human level. Example: 1e6 size convolution in 80 ms: 11511.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I don't think so where you need to convolute polynomials of size greater than 1e6, it is the intended solution.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it -6 Vote: I do not like it

      No it's never intended solution (manual vectorization). Did you even read/open the code?

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Yes, I saw it, I just mean you don't need so much optimization in intended solutions :)

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it
»
4 years ago, # |
Rev. 3   Vote: I like it +8 Vote: I do not like it

Many Japanese contestants share their (huge) snippets on GitHub. Here are some examples

https://shino16.github.io/cplib/ (this is mine)

(Search GitHub for contestants' account and you'll find repositories with lots of snippets)

Some are licensed, so please check it before you use it.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I use the AtCoder library