When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

Guwanch1's blog

By Guwanch1, history, 2 years ago, In English

I'm newbie and I'm solving problems in C++, but which one is better c++ or python, should i switch to python or better to stay in C++! Thank you!

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

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

For competitive programming, C++ almost always wins, but knowing python would help in problems that require to work with big numbers. Maybe you can avoid it, but if solution with big numbers is easier, it's better to just code it in python

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

C++, I use python and sometime i just stuck on problem due to TLE but when somehow i do it with C++ it got AC so C++ is of course better than python don't switch on python.

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

Well if you are already writing code in c++, then continue writing code in c++. Why is it better? C++ is simply more functional and faster. BUT if you have to work with long numbers (more then 128 bits) people usually use python.

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

Well, there are some pros and cons of both: C++ has better execution time, with C++ you are more likely to find implementation of a certain algorithm or data structure, each problem can be solved in C++ (unlike python), it also has broad variaty of built-in data structures: red-black trees, hash tables etc. On the other side, there is python: it has extremely easy syntax but there are some issues with memory (python consumes tons of it), standard input is kinda slow. Although python is very slow, it's still viable.