What are some basic c++ programming techniques?

What are some essential programming techniques to surpass the time and memory constraints in competitive programming?

  • I am good at basics and learning but sometimes some codes seem esoteric to me and I don't find any technique(used commonly by programmers in their solutions) that is explained in some book that I have been following. Could someone help with their experiences.

  • Answer:

    The best technique is to find a better algorithm. Time limits are set such that you don't require micro optimization if your algorithm is optimal. But if you really feel you have to shave off a fraction of a second you can look into using faster input/output. http://stackoverflow.com/questions/12073617/fast-input-output-function.

Shreyas Basarge at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.