Recently, more and more people are asking questions that have been answered many times before. This FAQ covers virtually all of them, so please make sure you have read it.
Why is my code not correct?
- Why do I get a Compile Error (CE)?
- Why do I get Wrong Answer (WA)?
- Why do I get a Time Limit Exceeded (TLE)?
- Why do I get a Runtime Exception (RE)?
- Why do I get a SIGSEGV?
- Why do I get a SIGABRT?
- Why do I get a SIGFPE?
- Why do I get an NZEC?
- Why do I get an internal error?
- How does Codechef test whether my solution is correct or not?
- How should I test my program?
- What am I allowed to post as a comment for a problem?
- How do I post a link to my code?
- How does the time limit work?
- What does the execution time displayed for my submission mean?
Other common mistakes
In Java, do not create multiple BufferedReaders on the standard input stream. Create it once, and use it from there. Creating it multiple times will lead to a wrong answer due to the method Codechef uses to test your program. Different operating systems have different ways of representing a newline; do not assume one particular way will be used. For example, on Unix a newline is simply a \n character. On Windows, a newline is represented by \r\n, and not testing for the \r character will lead to problems. Ideally, use input reading functions from your language which handle new line issues for you.
Other common questions
- If a number of test cases isn't provided, when should my program stop reading input?
- What should I do with invalid input?
- How can I store very very large integers accurately?
- In C/C++, how should I read/write long longs?
- If my code gets TLE, does that mean it is correct but takes too long?
- Why can I view other people's solutions? Can they view mine? What is stopping people copying other's code?
- Can I see if my solution to a contest problem is correct after the contest has finished?
- How can I measure the execution time of my program locally?
- Are any compiler flags set on the online judge?