Hello Codeforces, The one with c++ please tell how c++ is better than python excluding compile time and the one with python tell how python is better than c++ especially for cp
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Hello Codeforces, The one with c++ please tell how c++ is better than python excluding compile time and the one with python tell how python is better than c++ especially for cp
Name |
---|
python is a snake and c++ is coding language
C++ is emoji :L
Compile time aside,
C++ has good library support like std::set and pbds that python doesn't have. Also, since C++ is more popular. This means that there are a lot of library codes (Atcoder library) and tutorials are mostly in C++. On sites where you can view the codes of others, you have a lot more sample working C++ code than Python code.
Python is very succinct and so you can code stuff up very fast. And you don't have to worry about integer overflow. However you can't go deep in recursion (shallow recursion limit). It's also more widely used in the real world so more applicable for a career.
True
IMO c++ has a better STL library with data structures that support better operations. For instance, take the ordered set in c++. You can easily check element at any index in O(logn) time complexity and it remains sorted. For a python set, it is not that simple to find some element without knowing it already exists in there. Moreover, the set doesn't remain sorted and its not subscriptable.(There are workarounds regarding this problem though, but its simpler and easier in c++)
Another example is the default dictionary in python. It stores the keys in arbitrary order. We have to import separate modules for sorted dictionary and ordered dictionary.
Other than that, python is far more simpler and easier to understand. Even though there will be more references for questions in c++ as compared to python, but one can easily understand and convert code from c++ to python with a little understanding.
both have their pros and cons use whatever suits u..good luck
Actually I have seen people using both during contests. Mostly they prefer C++ though. And one more important point to note, python is opted usually for string problems and C++ for deep recursion problems. Otherwise, at the end of the day it's your skills that matter. So as long as you don't always try to brute force every problem you encounter but instead try to come up with an optimized approach, you are good to go with either of the languages :)
Python includes : 'P','y','t','h','o','n' But C++ Includes : 'C','+','+'
It means C++ is better. : )
It means you are using a multiset