Things to Know Before Attempting The Test
- Code Ground is an automatic code evaluation platform.
- First of all, you need to understand that a machine is going to evaluate your code. So, Code has to be written with this understanding.
How To Test Your Code?
- Your program should always read from Standard Input (
stdin) and print to Standard Output(
Your code should not try to read input from program arguments
- The input stream can be read at any point of time and not necessarily all at once.
- The program can be tested in your local machine by giving input file as the input to the Standard input stream and taking an output to the output file. (CodeGround run your code in similar fashion)
For eg, a similar execution of a
Cprogram will look like this.
./a.out < input.txt > output.txt
input.txtwould be the input to the program and
output.txtwill be the file where output is written.
Once, the output file is generated, match it with the expected output of the program with precision including whitespaces and newlines.
However, CodeGround output checker will ignores any trailing newline appears after the output.
- There is a global time limit to the execution environment which enforces that your program should be executed within 4 seconds and 256 MB per Testcase file.
- Make sure you are using a compiler that complies with the standards. For instance, Turbo C++ is not such a compiler, and often code which compiles in Turbo C++ will not compile on the online judge.
Following runtime are available to compile and run your code.
JAVA --> oracle java 1.7.0_79 C --> gcc version 4.8.3 C++ --> gcc version 4.8.3 Ruby --> ruby 2.0.0p598 Python -> Python 2.7.5
3. In case of
public static void main(String arg) should be included in a public class with class name as
You can click compile and run to check if your code passes or fail test case.
There are various types of indicators given to the user as output during compilation and execution scenarios. Each of them is described below.
- Compile Time Error: As the name suggests, this error states that there was an error compiling the program on the server. Codeground does not detail precise information on compile time errors.
- Runtime Error : As the name suggests, this error states that there was a runtime error while executing the program on the Codeground’s server. Codeground does not detail precise information on the runtime errors.
- System Error : This error appears when the request is timed out which might be caused if the Codegrounds server is momentarily down or has some issues. In this case, please try the same action again. If the error persists, please contact the Codegrounds Support.
- Timeout : This means that the execution of one of the Testcase file exceeded the upper bound of 4 seconds.
- Pass : This denotes that the output of the program successfully matched with the expected output.
- Fail : This denotes that the output of the program did not match the expected output.
Make sure you click
finish test to submit your code before time duration finishes.