On the insertion sort algorithm, I wrote a typical algorithm that takes O(n^2) worst case. Initially I used Python, and it gave me a TLE when the input list is big (5000 sorted elements). Later I rewrote the exact algorithm in C++ and it was accepted.

I understand Python will be slower being interpreted language and all. But hasn't OJ taken that into consideration and scale the criteria accordingly?