-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWhat not to do.
12 lines (12 loc) · 989 Bytes
/
What not to do.
1
2
3
4
5
6
7
8
9
10
11
12
- Don't read directly a number you want to store in an unsigned char.
- Don't forget to use setprecission and fixed whenever you encounter a problem with floats or doubles.
- Don't assume input constraints are always correct.
- WA on CF can also mean the program is stuck somewhere in a loop.
- If you use DFS,BFS,LEE, don't forget to mark the current node as visited before adding it to the queue and calling the function again.
- Don't use labs or fabs unless you really have to.
- Don't use set if you only need the items sorted. Use vector and sort it instead. Much much quicker due to no logn insertion.
- Don't use ll for long long in scanf and printf, use lli.
- Don't forget to use the <functional> header for pre-made STL comparators.
- Don't forget there are 26 letters in the english alphabet, not 25.
- Don't forget to use multiset instead of set when you think multiple appearances might occur.
- Don't forget that any even number can be written as a sum of 2 prime numbers.