Hacker News new | ask | show | jobs
by natdempk 1763 days ago
Isn't this basically what competitive programming is? Maybe I'm a bit clueless, but my assumption was most people have standard libraries of common algorithms/implementations they pull from and tweak/glue as needed to fit the problem in front of them. Those libraries are not standardized, but there is for sure basically a common set of things you need to be competitive, right?
2 comments

I haven't done competitive programming in years, but when I did we were allowed to use things like Boost in C++ or the standard library in Python.

I can't really recall any scenarios where a stdlib datastructure was slightly too slow, but re-implementing your own version was just fast enough to get by. The problems were typically created in a way where using any common algorithm was 1000x too slow, and you needed something like dynamic programming to make things run in a reasonable amount of time. Or they were a math problem masquerading as a programming problem.

There is a common set of algorithms that most people who do well in such a contest can implement whenever they like, but most of the effort involved in solving the problems happens before they write any code, and many (half or more?) problems can't be solved by just applying the techniques from this repertoire.
This is correct. A typical CodeForces problem is intentionally constructed as a unique snowflake that can't be solved by just calling a library function. You need to be able to design an algorithm that solves that specific unique snowflake on the spot. Perhaps your algorithm also makes some library calls to other algorithms in your comp.coding library, but those are merely building blocks for your own thing, which you have to invent.