Many readers of this blog use to take part in online programming competitions and there are several problems, which are run-time bound. Usually when one gets a time-out error, one tries to revisit one’s logic. That’s the first thing to do but if you still are not making required progress you can try following tips:
C/C++:
Use printf, scanf over cin and cout: To get faster I/O operations. If you have enormous data to read, this will help you for sure.
Keep an eye on STL usage: STL is excellent for lessen your efforts and provide very smart inbuilt methods for many complex tasks but on the cost of time. An intelligent programmer can save time writing his/her own methods.
Note: This might cause you to take longer to solve a problem and STL beautify your code with fewer efforts. I personally love STL and everyone should use it in practice. But this can be a significant contributor in time-out frequently.
Ruby:
If you are using hash, avoid hash[“string”] it performs badly in terms of space and time. Use hash[:symbol] instead.
General:
- Avoid nested loops
- Check boundaries carefully
- Take care of program stack; not many folds/unfolds.
Subscribe - To get an automatic feed of all future posts subscribe here, or to receive them via email go here and enter your email address in the box. You can also like us on facebook and follow me on Twitter @akashag1001.
And indeed, I’m just always astounded concerning the remarkable things served by you. Some four facts on this page are undeniably the most effective I’ve had.Programming question are very useful.
selenium training in chennai
Thanks for posting this information. Keep updating.
Spoken English Classes in Chennai
Best Spoken English Institute in Chennai
french courses in chennai
pearson vue
Blockchain Training in Chennai
Ionic Training in Chennai
Spoken English Classes in Velachery
Spoken English Classes in Tambaram
Thank you for taking the time to discuss this informative content with us. I feel happy about the topic that you have shared with us.
data science training in chennai
data science training in tambaram
android training in chennai
android training in tambaram
devops training in chennai
devops training in tambaram
artificial intelligence training in chennai
artificial intelligence training in tambaram
I must appreciate you for providing such a valuable content for us. This is one amazing piece of article. Helped a lot in increasing my knowledge
data science training in chennai
data science training in porur
android training in chennai
android training in porur
devops training in chennai
devops training in porur
artificial intelligence training in chennai
artificial intelligence training in porur
Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live..
data science training in chennai
data science training in omr
android training in chennai
android training in omr
devops training in chennai
devops training in omr
artificial intelligence training in chennai
artificial intelligence training in omr
Nice article and thanks for sharing with us. Its very informative
Plots in TUKKUGUDA
very goodsalesforce training in chennai
software testing training in chennai
robotic process automation rpa training in chennai
blockchain training in chennai
devops training in chennai
Do you want to know about Nina Marie Daniele Net Worth, early life, biography, age, and relationship status?