You are not logged in. Please login at to post your questions!


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?

asked 29 Oct '14, 17:41

ramher237's gravatar image

accept rate: 28%

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.


answered 29 Oct '14, 17:48

pranjalranjan's gravatar image

accept rate: 20%

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


answered 29 Oct '14, 18:42

the65bit's gravatar image

accept rate: 13%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 29 Oct '14, 17:41

question was seen: 561 times

last updated: 29 Oct '14, 18:42