Skip to content

Frequently Asked Questions

Meanings of Various Judge Statuses?

Here is a table of the meanings of the judge statuses:

StatusMeaning
PendingThe judge is busy and cannot judge your submission temporarily. Usually, you just need to wait for about a minute, and your submission will be judged.
Running & JudgeYour code is running and being judged.
Compile Error (CE)Your code cannot be compiled, usually because there are syntax errors in your code.
Accepted (AC)OK! Your program is correct!.
Presentation Error (PE)Your output format is not exactly the same as the judge's output, although your answer to the problem is likely correct. Check your output for spaces, blank lines,etc against the problem output specification.
Wrong Answer (WA)Your program did not produce the correct result.
Runtime Error (RE)Your program encountered an error during execution, usually due to reasons such as array out of bounds, division by zero, etc.
Time Limit Exceeded (TLE)Your program ran longer than the judge's time limit.
Memory Limit Exceeded (MLE)Your program used more memory than the judge's memory limit.
Output Limit Exceeded (OLE)Your program tried to write too much information. This usually occurs if it goes into an infinite loop.
System Error (SE)The judge encountered an error, which may not be your fault. Please relax.

Compiler / Runtime Environment of the Judge?

The compiler / runtime environment of the judge is as follows:

LanguageCompiler / RuntimeCompiler Options / Runtime Options
Cgcc 12.2.0gcc Main.c -o Main -std=c11 -O2 -lm -DONLINE_JUDGE -w --static
C++ 11g++ 12.2.0g++ Main.cpp -o Main -std=c++11 -O2 -lm -DONLINE_JUDGE -w --static
C++ 17g++ 12.2.0g++ Main.cpp -o Main -std=c++17 -O2 -lm -DONLINE_JUDGE -w --static
Javaopenjdk & javac 17.0.14javac Main.java -encoding UTF-8
java -DONLINE_JUDGE Main
Python 3Python 3.11.2python -m py_compile Main.py
python Main.py
PyPy 3Python 3.9.16
PyPy 7.3.11
pypy3 -m py_compile Main.py
pypy3 Main.py

Can my program know if it is running on the judge?

Yes, you can determine whether your program is running on the judge in different ways. C and C++ use macro definitions, Java uses system properties, and Python uses environment variables to determine whether the program is running on the judge. Here are some examples:

C / C++

c
#include <stdio.h>

int main() {
#ifdef ONLINE_JUDGE
    printf("Running on the judge\n");
#else
    printf("Not running on the judge\n");
#endif
    return 0;
}

Java

java
public class Main {
    public static void main(String[] args) {
        if (System.getProperty("ONLINE_JUDGE") != null) {
            System.out.println("Running on the judge");
        } else {
            System.out.println("Not running on the judge");
        }
    }
}

Python 3 / PyPy 3

python
import os

if os.getenv("ONLINE_JUDGE") == "1":
    print("Running on the judge")
else:
    print("Not running on the judge")

Why does my C / C++ code that compiles locally fail to compile on the judge?

It may be due to some differences between GNU and MS-VC++, such as:

  • main must be declared as int, void main will end up with a Compile Error.
  • i is out of definition after block for (int i=0; ...) {...}
  • itoa is not an ANSI function.
  • __int64 of VC is not ANSI, but you can use long long for 64-bit integer.