refer book “Introduction to Algorithms”, written by Cormen and some other guys, is considered Bible on this topic. It contains pretty much all the algorithms, math and data structures you need to know for programming competitions.
Implement all the algorithms you’ve learnt in as many ways as possible.
As you said implementation is your main problem, you might be messing up with the corner cases. Be careful with them.
Try to solve codeforces contest archives. Spend some time on each of them and then look into the editorials. This will help a lot if you plan to take ACM ICPC.
You can also try out topcoder algorithm tutorials and contests.
Most people use c++ for competitive coding , so if you are looking forward to it you should make tourself familiar with STL in c++.
Recommended books: Introduction to Algorithm (popularly known as CLRS) bt cormen.