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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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