Рет қаралды 19,955
A compilation of various mistakes commonly made in C++ programming, as well as competitive programming in general. I explain what they are, what causes them, and what you can do to try to avoid them in the future.
Stuff I said would be here:
"Excess precision": codeforces.com/blog/entry/78161
More info on sorting comparator ("strict weak ordering"): www.boost.org/sgi/stl/StrictW...
Blog on hashing: codeforces.com/blog/entry/62393
Blog on rand(): codeforces.com/blog/entry/61587
C++ documentation site: en.cppreference.com/
Overview slides: docs.google.com/presentation/...
If I forgot to put anything here, please let me know.
Topics covered:
Intro 00:00
Uninitialized variables 01:31
Index out of bounds 03:04
I/O optimizations (and misusing them) 05:23
Over/underflow 09:34
Handling floats, precision errors 12:47
Handling modulo 15:46
Multiple test cases, global variables 17:00
Shadowing 20:33
Operator precedence 21:21
Mishandling sorting comparators 22:39
Some extra STL/built-in stuff 23:43
General tips & outro 26:07