Common C++ Coding Mistakes (and how to prevent them)

Common C++ Coding Mistakes (and how to prevent them)

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": https://codeforces.com/blog/entry/78161
More info on sorting comparator ("strict weak ordering"): https://www.boost.org/sgi/stl/StrictWeakOrdering.html
Blog on hashing: https://codeforces.com/blog/entry/62393
Blog on rand(): https://codeforces.com/blog/entry/61587
C++ documentation site: https://en.cppreference.com/
Overview slides: https://docs.google.com/presentation/d/1dSSWT9sQSmBltyb4zQQPzV-PwSrQikav4zVtj0v0QZU/edit?usp=sharing

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

codecodingc++

Post a Comment

0 Comments