new in competitive programming

I am new in programming activities like contests which are held online. I just started learning coding and I have participated in one of the coding competitions in our university. I just want to ask if I still have to check the restrictions/constraints for test cases given in the problems. In the competition that I joined, its not verbally implemented but they marked the answers wrong if you dont check for the restrictions. How about online/international competitions? Is it necessary to check for the restriction given?

You dont have to check in your code but you have to keep it in mind. Suppose a problem says you have to take 10^6 numbers as input in the worst case and u declare an array of say 1000 while making your code (without looking at the constraints) then you will get a wrong answer. Constraints are there to make you sure of the bounds of memory you need to keep in mind while making your code.

4 Likes

No. The test files do not contain invalid input . Inputs are always in the range mentioned in the constraints .