0

If i already know python, should i learn C++ for competitive programming?

I know a lot in python. Now, i have decided that, i will spend time doing some serious Competitive programming. Should i start learning C++ for this now or should i continue with python?

10th Jun 2021, 3:18 PM
Sajid Chy
Sajid Chy - avatar
3 Antworten
+ 3
Although main focus in cp would be on the algorithm that you choose to solve the problem, using C++ sometimes makes it possible to crack some problems with relatively less efficient algorithm because of it's speed. That being said, all the problems are designed in such a way that it should be possible to solve them in the given amount of time in any language that they allow. Some competitions also provide a longer time limit for slower languages like python. So i think you will rarely encounter a place where your choice of language will bottleneck your performance in cp.
11th Jun 2021, 12:54 AM
Arsenic
Arsenic - avatar
+ 2
I think you should learn c++ for cp major reason is stl it has some prebuild data structures which saves your time on contest time. And also I seee almost 70 to 80 percent of people do coding in c++ so there will be better community for c++. And lot of site which have very good info for cp uses c++ for example codes. So I think you should learn c++ for cp if you can
11th Jun 2021, 1:38 AM
YUGRAJ
+ 1
As I guess you should continue to learn Python as you have a plenty of other courses unfinished. So keep learning Python and after that you can learn C++ more easily.
10th Jun 2021, 5:52 PM
Ervis Meta
Ervis Meta - avatar