Recently, I participated in Codeforces Round 873 (Div. 2). I was doing well, and in the last 5 minutes of the contest I solved problem D1, putting me at rank 200 and with CM performance. I was happy with myself until this happened:
I saw that I got TLE on test case 13 and quickly realized what happened. I chose to use Java in this round, and I had somehow fallen in another one of Java's traps. Now, I've decided to compile a comprehensive list of these pitfalls so no one can FST to them again. (Hopefully after you see this you'll be convinced to just use C++.)
1. Array sorting
Problem
Solution 1
Solution 2
Solution 3
2. String concatenation
Problem
Solution
3. Input/output
Problem
Solution
4. Comparing objects
Problem
Solution
5. Stacks
Problem
Solution