AlwaysACoder's blog

By AlwaysACoder, history, 5 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?
»
5 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it
»
5 years ago, # |
  Vote: I like it +8 Vote: I do not like it
»
5 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.

  • »
    »
    5 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.

    • »
      »
      »
      5 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?

      • »
        »
        »
        »
        5 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 :)

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it
»
5 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.

»
5 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