how should I start with competitive programming?

I am new to this so can anyone give me an idea where to start from. I have looked at some beginner level programs and I cant understand what they mean to say by constraints and all that stuff.

Sheer Practise.

The constraints are there just to tell you about the data range which will be provided in the test case.
It also helps you judge the datatype to be used in your solution.
For Example if it says 0 <= x <= 10^9, then you know that x will not fit in an integer type and you will have to go with long data type.

The contraints also give an insight about the intended time complexity of your solution.
For Example if it says 0 <= n <= 10^5 then you cannot give an O(n^2) solution, you will have to be better than that O(n) or O(n log n).

1 Like

Try from hackerrank.com . It will spoonfeed you a bit till you are capable of doing things on your own. It provides with ready-made I/O templates, and at times array’s etc. already declared.

Constraitns means that input’s value lie between those 2 numbers. It wont be less than it, or more than it. It iwll be strictly in between- a way of problem setter to say that 'I am testing your code for values in this range". Helps you decide on logic, data types etc.

Make sure to print exactly whats given in output, anything more or less is given WA.

//