Frequently Asked Questions
Meanings of Various Judge Statuses?
Here is a table of the meanings of the judge statuses:
| Status | Meaning |
|---|---|
| Pending | The 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 & Judge | Your 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:
| Language | Compiler / Runtime | Compiler Options / Runtime Options |
|---|---|---|
| C | gcc 12.2.0 | gcc Main.c -o Main -std=c11 -O2 -lm -DONLINE_JUDGE -w --static |
| C++ 11 | g++ 12.2.0 | g++ Main.cpp -o Main -std=c++11 -O2 -lm -DONLINE_JUDGE -w --static |
| C++ 17 | g++ 12.2.0 | g++ Main.cpp -o Main -std=c++17 -O2 -lm -DONLINE_JUDGE -w --static |
| Java | openjdk & javac 17.0.14 | javac Main.java -encoding UTF-8java -DONLINE_JUDGE Main |
| Python 3 | Python 3.11.2 | python -m py_compile Main.pypython Main.py |
| PyPy 3 | Python 3.9.16 PyPy 7.3.11 | pypy3 -m py_compile Main.pypypy3 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:
mainmust be declared asint,void mainwill end up with a Compile Error.iis out of definition after blockfor (int i=0; ...) {...}itoais not an ANSI function.__int64of VC is not ANSI, but you can uselong longfor 64-bit integer.