C++ templates for competitive programming