HelpThe CodeChef SystemExampleTechnical Issues related to C/C++Technical issues related to other OS system usersThe CodeChef SystemSubmitted solutions are automatically compiled and run under Linux test system. You must keep strictly the input output specification. In particular your program must not printout any additional messages like 'input the number please', which are not specified in the problem formulation. CompilersSubmitted solutions are compiled according to the user selection made during the submission process. For example:
Source code length restrictionSource code length is restricted to 50 000 bytes in a one file. Additional restrictions might be provided for particular problems. Using external libraries or files is prohibited. Execution time restrictionExecution time is restricted for each problem and for each test case separately. In each case restriction is not severer then 1s. Solutions are tested on equal PIII 733 MHZ processors. Memory restrictionAccessible memory is at least 64MB. Input OutputProgram should read from standard input and write into standard output. There is no need to read all data first, compute them all and then print all output. It is recommended to read and write data as simultaneously. Technically, server redirects standard stream to files. You can test you programs in the same way at home. ExampleTask: write the program to find sum of two integers. Input two integers A and B. Output the sum of these integers. Input example:
Output example: Solution in C:
#include <stdio.h>; int main() { int a, b; scanf("%d %d", &a, &b); printf("%d\n",a+b); return 0; } Solution in PASCAL:program ex; var a, b: integer; begin read(a,b); writeln(a+b); end. Solution in Java:public class Main { public static void main (String[] args) throws java.lang.Exception { java.io.BufferedReader r = new java.io.BufferedReader(new java.io.InputStreamReader(System.in)); int a = Integer.parseInt(r.readLine()), b = Integer.parseInt(r.readLine()); System.out.println(a + b); } } Solution submittingTo submit a solution choose problem from list of problems and press button 'Submit' at the top of the problem description. You can submit multiple solutions to each problem. Score for the problem is equal to the score of the best submitted solution. To see the Statistic for problem choose problem from list of problems and press button 'All submissions' at the top of the problem description. To view the status, hover over the check box, cross or warning icon in the result column. At present the following status codes are available:
Technical issues related to C/C++Debugging at homeYou could use symbolic constant ONLINE_JUDGE for debugging purpose. In C you can use:
Input data are taken from input.txt, and output data are print to output.txt only outside the CodeChef system. Technical issues related to other OS system usersNew line encodingPlease consider it important that a new line characters can differ between Linux and other OS. It might be a cause of malicious bugs. Using 64-bit number typesIf you use a compiler in which a long long type does not exist (like MS VisualC++) then to assure proper compilation you can create a symbolic constant:
In this case do not forget about proper output format: %lld instead of %I64d in the case of using scanf/printf functions.
|