Amrit Srivastava : Comprehensive guide for getting started into competitive/sports programming

Amrit Srivastava
HackSlash
Published in
3 min readSep 2, 2017
(Source : Google Images)

The thing that fascinates me towards programming is that you just once set some logic and then get the answer just by inputting some values, you need not calculate for each input again and again.

Programming is an art of making things easier writing just a few lines of code.

In the present scenario, most of the students think that programming is just making simple programs that we are studying in our syllabus like find prime numbers, factorial, even or odd numbers, etc. You can find resumes full of programming languages, and yet struggling with implementing algorithms.

Analysis and Constraints

In starting my opinion was also same for programming, but when I came across “competitive programming” for the first time it left me wondering. The questions there are totally different from what we study. Sometimes, there are more than one way to solve a problem. So, there we need to learn how to compare the performance different algorithms and choose the best one to solve a particular problem. While analyzing an algorithm, we mostly consider time complexity and space complexity.

  • Time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the input.
  • Space complexity of an algorithm quantifies the amount of space or memory taken by an algorithm to run as a function of the length of the input.
(Source : https://www.google.co.in/analysis_of_algorithms)

Order of growth is how the time of execution depends on the length of the input. In the above example, we can clearly see that the time of execution is linearly depends on the length of the array. Order of growth will help us to compute the running time with ease.

But if we go for competitive programming there we have theoretical problems to code, there are questions having situations where we have been given some variables and constraints for each given variable and it’s quite difficult to code these type of problems at first. For example, in a simple program that we make we have just 5 to 10 cases to check that program, but in these problems that we face are

  • Improper declaration of datatypes
  • Program exceed the time limit
  • Doesn’t pass all the test cases.

Where to practice ?

To overcome these problems and solve these type of problems we should be good at writing algorithms. Now the next question is that from where to learn to solve these type of problems? There are many online sites which may help you out in solving these problems. Some of them are

And many more. There you get hundreds of different problems to practice. And trust me, there’s nothing better than “learning by doing” when it comes to programming!

So, start practicing to get a good career opportunity and making most out of your 3/4 years.

“Programming is like mathematics, the more you practice the more you get”

References :-

  1. Google.com
  2. Hackerrank.com

--

--