Competitive Programmimg

How practical is it to use python for competitive programming? Should I just learn C++ and not waste time trying to use a slow language, or do you think the advantages of Python outweigh the disadvantages in this situation? I haven’t found many books to help with competitive programming in Python, but obviously data structures and algorithms are still common in the language. What do you guys think?

4 comments · 76% upvoted · other discussions

comments

ignitzhjfk

I tried to use Python for competitive computing for hobbie. No success because I cannot control the use of memory of complex structures with pure python implementation or it's not enough faster.

It is faster with a library compiled in binary (C, C++) or some other tools common used. Example: pandas, tensor flow, some edge stuffs. But you are not allowed to use third party libs to developer a solution.

Maybe any interpreted languages (node, python, ruby) it is not enough to pass in a complex test on an online judge. Have some strategies to make this languages faster, JIT compiler, but will be better to use a compiled language to be hardcore on this thing. Example: C, C++, Java, Rust, Go, etc.

RedditGood123 [OP]

Thanks! What are some python libraries compiled in binary?

ignitzhjfk

Like a .exe on Windows

erick_dev

I'm not an expert but seems that competitive programmers use different languages for different question, it's not a rule but a question solution may be better in one language than other

And yes, both python and c++ seems to be the favorites to solving quests