1 / 15
Jun 2004

Status codes on spoj need clarification.
Right now, they can be:

[ul][b]1. AC[/b] - accepted - your program ran successfully and gave a correct answer

2. WA - wrong answer - your program ran successfully, but gave an incorrect answer

3. TLE - time limit exceeded - your program was compiled successfully, but it didn't stop before time limit

4. 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)

5. 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[/ul]

  • created

    Jun '04
  • last reply

    Oct '19
  • 14

    replies

  • 3.3k

    views

  • 9

    users

  • 2

    links

2 years later

Just curious , But isnt the maximum memory limit supposed to 64 MB . In the same submission 599281 .. i had these lines

long double MEMORY[10000000]; // Yup 7 Zeroes
...
..
int main(){
            for(int i=0;i<1e7;i++) MEMORY[i]++;
            ..

Dont i occupy more than 64 MB ?

64MB is the guaranteed amount of memory you can use. It is also enought to solve all problems.
If you're lucky, in some languages, you can use more.

... or in Java, you can use less (is it true that the JVM is still run with -Xmx32M ?)

Sorry about the late reply.

/usr/local/jre/bin/java -Xms32m -Xmx32m -Xss1024k -Xbatch [..classpath..]

I believe you are suggesting that this should change smile. We'll try to do something about it shortly.

w00t! I figured if I took every chance to bring it up, sooner or later someone would notice wink I suppose I could have emailed you, too, but that would be too easy.

-Xms64m -Xmx64m -Xss1024k -Xbatch -cp (...)

(feel free to suggest other VM options... docs are quite cryptic for -X* options, maybe someone has better ideas)

21 days later

Python is now compiled prior to execution AFAIK to allow for syntax-error checks and for faster program loading. Therefore, syntax errors in Python will throw CE, and runtime errors (exceptions) will throw RE:NZEC because the interpreter exits with nonzero status.

BTW: If you use Brainf**k for a problem and SIGSEGV appears, that means that the program tried to "<" past the left end of the 30000 cell array (pointer starts at the left, at location 0), or ">" past the right end (could happen with a construct like [>+]). TLE in Brainf**k usually means trying to use [-] cell clear on a negative value: 32767 subtractions will take a fair bit of time and possibly cause TLE if too many are used.

What result is given if someone tries to do something like fopen("/etc/passwd","r"); or some other nefarious "restricted function" (sockets, pipes, file I/O, sabotage, etc.)?

All those function behave naturally.
fopen("/etc/passwd") will fail with ENOFILE (true - there's no such file in C/C++ chroot), creating sockets fail with ENOPERM (thanks to grsec), pipes are perfectly allowed, etc.
Anyway, the program won't be killed if you do something disallowed - it just won't work, returning a clean error.

5 years later
7 months later

TLE - time limit exceeded - your program was compiled successfully, but it didn't stop before time limit

Does this mean, it took long time to compile ? Or Execution took a long time ?

Execution. Note that for some languages they are not precompiled, therefore execution and compilation are both considered execution time.

6 years later

Does Time Limit Exceeded mean that my program gave good answers but it achieved time limit, or that it was giving good answer but achieved time limit and it was immediately stopped (so i don’t know if my program gave good answers)?