Hello everyone ... recently I learned C++ language and joined to competitive programming World , I Just want to know if OOP ( Object-Oriented programming ) is important for me !? , such as " Struct " && " Class " .. Thanks in advance =D
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
Hello everyone ... recently I learned C++ language and joined to competitive programming World , I Just want to know if OOP ( Object-Oriented programming ) is important for me !? , such as " Struct " && " Class " .. Thanks in advance =D
Name |
---|
OOP is not really important for competitive programming. In most of my solutions I don't even define methods (except for main of course).
OOP is more useful in huge projects. It improves readability and usability. So you should definitely learn OOP, but it is not necessary for competitive programming sites like Codeforces.
OOP is not important at all in competitive programming.
Sometimes (like in Topcoder) you have to code the solution inside a class/struct, but otherwise you don't need OOP.
No. You might need to define your own custom structs on rare occasions but even that can be avoided.
You mean like pair<pair<pair<pair<........> > > > ?
I once solved a problem that asked which of two poker hands was biggest by representing each of them as a pair< int, pair< int, pair< int, pair<int, int> > >.
You can imagine how that was a real work of art :D
tuple! :D
which language? python and other scripting languages?
http://www.cplusplus.com/reference/tuple/
C++ too.
Holy! That does make everything so much easier. Wish I wasn't declaring structs all this time. :)
This reminds me of this problem :D https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1256