Some help

Sending solution
... choose problem from list of problems and press button 'Submit' at the top of the problem description

Statistic for problem
...choose problem from list of problems and press button 'All submissions' at the top of the problem description

Best solutions for problem
...choose problem from list of problems and press button 'Best solutions' at the top of the problem description

Status codes on spoj:
At present for SPOJ available next status codes:

AC - accepted - your program ran successfully and gave a correct answer
WA - wrong answer - your program ran successfully, but gave an incorrect answer
TLE - time limit exceeded - your program was compiled successfully, but it didn't stop before time limit
CE - compilation error - your program couldn't be compiled; compiler's errors can be seen from www and are sent via mail if your preferences say so; note: only some languages can give CE, syntax errors in intrerpreted languages can lead to WA (Python - no pre-checking syntax or Perl - CE only afer a basic syntax check)
RE - runtime error - your program was compiled succesfully, but it exited with an error; possible codes are:

- SIGSEGV(signal 11) - most common, "segmentation fault";
- SIGXFSZ(signal 25) - "output limit exceeded";
- SIGFPE(signal 8) - "floating point error", like division by zero, etc.;
- SIGABRT(signal 6) - raised by the program itself; C++ STL does it under some conditions;
- NZEC(non-zero exit code) - helps telling crash from WA with interpreted languages;
- other - there are other signals which can cause program to terminate, all remaining are shown as other;

Time limit
Every task has time limit. If program doesn't end within time limit solution will recieve status code TLE.

Input and output data
You should use stdin and stdout standard streams. These file streams are accessible by default to reading and writing in many languages. So, you can use scanf/printf in language C or read/write (without a name of a file) in language Pascal.

Example of solving the problem
Task: write the program for sum two integers. On input two integers A and B. On output sum of these integers.
Input example:

2 3

Output example:

5

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.


Debugging at home
You could use macros ONLINE_JUDGE for debugging purpose.
In C you can use:

#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif


All input will be read from file input.txt. All output will be stored in file output.txt.

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.