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 | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
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