各种OJ的FAQ收集!

gdgzoi.com(英文版):

Q:What is the compiler the judge is using and what are the compiler options?
A:The online judge system is running on Ubuntu. We are using GNU GCC/G++ for C/C++ compile and Free Pascal for pascal compile. The compile options are:

C:	gcc Main.c -o Main -fno-asm -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++:	g++ Main.cc -o Main -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGE
Pascal:	fpc Main.pas -o Main -O2 -Co -Cr -Ct -Ci
Our compiler software version:
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Free Pascal Compiler version 2.6.2 [2014/01/22] for x86_64
Q:Where is the input and the output?
A:Your program shall read input from stdin('Standard Input') and write output to stdout('Standard Output').For example,you can use 'scanf' in C or 'cin' in C++ to read from stdin,and use 'printf' in C or 'cout' in C++ to write to stdout.
User programs are not allowed to open and read from/write to files, you will get a "Runtime Error" if you try to do so.

Here is a sample solution for problem 1000 using C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
Here is a sample solution for problem 1000 using C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
Here is a sample solution for problem 1000 using PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.
Q:Why did I get a Compile Error? It's well done!
A:There are 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.
try use #define __int64 long long when submit codes from MSVC6.0
Q:What is the meaning of the judge's reply XXXXX?
A:Here is a list of the judge's replies and their meaning:
Pending : The judge is so busy that it can't judge your submit at the moment, usually you just need to wait a minute and your submit will be judged.

Pending Rejudge: The test datas has been updated, and the submit will be judged again and all of these submission was waiting for the Rejudge.

Compiling : The judge is compiling your source code.
Running & Judging: Your code is running and being judging by our Online Judge.
Accepted : OK! Your program is correct!.

Presentation Error : Your output format is not exactly the same as the judge's output, although your answer to the problem is correct. Check your output for spaces, blank lines,etc against the problem output specification. We have deleted "Presentation Error" judgement since April 9, 2015. Answers with "Presentation Error" will be accepted. 

Wrong Answer : Correct solution not reached for the inputs. The inputs and outputs that we use to test the programs are not public (it is recomendable to get accustomed to a true contest dynamic ;-).

Time Limit Exceeded : Your program tried to run during too much time.

Memory Limit Exceeded : Your program tried to use more memory than the judge default settings. 

Output Limit Exceeded: Your program tried to write too much information. This usually occurs if it goes into a infinite loop. Currently the output limit is 1M bytes.

Runtime Error : All the other Error on the running phrase will get Runtime Error, such as 'segmentation fault','floating point exception','used forbidden functions', 'tried to access forbidden memories' and so on.
Compile Error : The compiler (gcc/g++/gpc) could not compile your ANSI program. Of course, warning messages are not error messages. Click the link at the judge reply to see the actual error message.

Q:How to attend Online Contests?
A:Can you submit programs for any practice problems on this Online Judge? If you can, then that is the account you use in an online contest. If you can't, then please register an id with password first.

CUGOJ(中文版):

Q:这个在线裁判系统使用什么样的编译器和编译选项?
A:系统运行于Debian/Ubuntu Linux. 使用GNU GCC/G++ 作为C/C++编译器, Free Pascal 作为pascal 编译器 ,用 openjdk-7 编译 Java. 对应的编译选项如下:
C:	gcc Main.c -o Main -fno-asm -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++:	g++ -fno-asm -Wall -lm --static -std=c++11 -DONLINE_JUDGE -o Main Main.cc
Pascal:	fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci
Java:	javac -J-Xms32m -J-Xmx256m Main.java 
*Java has 2 more seconds and 512M more memory when running and judging.
编译器版本为(系统可能升级编译器版本,这里直供参考):
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
glibc 2.3.6
Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386
java version "1.6.0_22"

Q:程序怎样取得输入、进行输出?
A:你的程序应该从标准输入 stdin('Standard Input')获取输入,并将结果输出到标准输出 stdout('Standard Output').例如,在C语言可以使用 'scanf' ,在C++可以使用'cin' 进行输入;在C使用 'printf' ,在C++使用'cout'进行输出.

用户程序不允许直接读写文件, 如果这样做可能会判为运行时错误 "Runtime Error"。

下面是 1000题的参考答案

C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.


Java:

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner cin = new Scanner(System.in);
		int a, b;
		while (cin.hasNext()){
			a = cin.nextInt(); b = cin.nextInt();
			System.out.println(a + b);
		}
	}
}
Q:为什么我的程序在自己的电脑上正常编译,而系统告诉我编译错误!
A:GCC的编译标准与VC6有些不同,更加符合c/c++标准:
main 函数必须返回int, void main 的函数声明会报编译错误。
i 在循环外失去定义 "for(int i=0...){...}"
itoa 不是ansi标准函数.
__int64 不是ANSI标准定义,只能在VC使用, 但是可以使用long long声明64位整数。
如果用了__int64,试试提交前加一句#define __int64 long long
Q:系统返回信息都是什么意思?
A:详见下述:
Pending : 系统忙,你的答案在排队等待.

Pending Rejudge: 因为数据更新或其他原因,系统将重新判你的答案.

Compiling : 正在编译.
Running & Judging: 正在运行和判断.
Accepted : 程序通过!

Presentation Error : 答案基本正确,但是格式不对。

Wrong Answer : 答案不对,仅仅通过样例数据的测试并不一定是正确答案,一定还有你没想到的地方.

Time Limit Exceeded : 运行超出时间限制,检查下是否有死循环,或者应该有更快的计算方法。

Memory Limit Exceeded : 超出内存限制,数据可能需要压缩,检查内存是否有泄露。

Output Limit Exceeded: 输出超过限制,你的输出比正确答案长了两倍.

Runtime Error : 运行时错误,非法的内存访问,数组越界,指针漂移,调用禁用的系统函数。请点击后获得详细输出。
Compile Error : 编译错误,请点击后获得编译器的详细输出。

Q:如何参加在线比赛?
A:注册 一个帐号,然后就可以练习,点击比赛列表Contests可以看到正在进行的比赛并参加。

大概其他的OJ都和这两个的其中一个很相似。

HUSTOJ(很像gdgzoi.com,不是吗?):

Q:What is the compiler the judge is using and what are the compiler options?
A:The online judge system is running on Debian Linux. We are using GNU GCC/G++ for C/C++ compile, Free Pascal for pascal compile and sun-java-jdk1.6 for Java. The compile options are:

C:	gcc Main.c -o Main -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++:	g++ Main.cc -o Main -O2 -Wall -lm --static -DONLINE_JUDGE
Pascal:	fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci
Java:	javac -J-Xms32m -J-Xmx256m Main.java 
*Java has 2 more seconds and 512M more memory when running and judging.
Our compiler software version:
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
glibc 2.3.6
Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386
java version "1.6.0_22"

Q:Where is the input and the output?
A:Your program shall read input from stdin('Standard Input') and write output to stdout('Standard Output').For example,you can use 'scanf' in C or 'cin' in C++ to read from stdin,and use 'printf' in C or 'cout' in C++ to write to stdout.
User programs are not allowed to open and read from/write to files, you will get a "Runtime Error" if you try to do so.

Here is a sample solution for problem 1000 using C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
Here is a sample solution for problem 1000 using C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
Here is a sample solution for problem 1000 using PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.
Here is a sample solution for problem 1000 using Java:

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner cin = new Scanner(System.in);
		int a, b;
		while (cin.hasNext()){
			a = cin.nextInt(); b = cin.nextInt();
			System.out.println(a + b);
		}
	}
}
Q:Why did I get a Compile Error? It's well done!
A:There are 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.
try use #define __int64 long long when submit codes from MSVC6.0
Q:What is the meaning of the judge's reply XXXXX?
A:Here is a list of the judge's replies and their meaning:
Pending : The judge is so busy that it can't judge your submit at the moment, usually you just need to wait a minute and your submit will be judged.

Pending Rejudge: The test datas has been updated, and the submit will be judged again and all of these submission was waiting for the Rejudge.

Compiling : The judge is compiling your source code.
Running & Judging: Your code is running and being judging by our Online Judge.
Accepted : OK! Your program is correct!.

Presentation Error : Your output format is not exactly the same as the judge's output, although your answer to the problem is correct. Check your output for spaces, blank lines,etc against the problem output specification.

Wrong Answer : Correct solution not reached for the inputs. The inputs and outputs that we use to test the programs are not public (it is recomendable to get accustomed to a true contest dynamic ;-).

Time Limit Exceeded : Your program tried to run during too much time.

Memory Limit Exceeded : Your program tried to use more memory than the judge default settings. 

Output Limit Exceeded: Your program tried to write too much information. This usually occurs if it goes into a infinite loop. Currently the output limit is 1M bytes.

Runtime Error : All the other Error on the running phrase will get Runtime Error, such as 'segmentation fault','floating point exception','used forbidden functions', 'tried to access forbidden memories' and so on.
Compile Error : The compiler (gcc/g++/gpc) could not compile your ANSI program. Of course, warning messages are not error messages. Click the link at the judge reply to see the actual error message.
Q:How to attend Online Contests?
A:Can you submit programs for any practice problems on this Online Judge? If you can, then that is the account you use in an online contest. If you can't, then please register an id with password first.

POJ(这是最特殊的一个):

omposing solutions
Common guidelines for composing solutions
The judge system challenges you with thousands of programming problems which demand diverse ideas and techniques to solve. Nevertheless, you must write the solutions in accordance with certain common guidelines so that they are judged as intended.

Guideline 1 Do exactly what the problems demand. A mistake made by some newcomers is to print some friendly-looking prompt messages such as “Please input an integer” which the problems do not ask for. Another example of violating this guideline is to leave debug information in the output. Our judge system is automated. There is no human involvement in judging the solutions. Neither the administrators nor the developers will read any output by the solutions in normal circumstances. Hence, unrequested prompt messages are virtually useless. Worse still, undesired output may mess with the jugding process, which in all probability will lead to rejection of the solution, even though it is logically correct.

Guideline 2 Access only the standard input, the standard output and the memory. Your solution must always read the input data from the standard input and write the output data to the standard output. The only location that your solution can utilize for storage is the memory. Access to other resources such as disks and the file system is denied by the judge system. Any such attempt results in undefined behavior.

Guideline 3 Write standard-conforming code. We promote the use of standard-conforming code. Certain compilers offer vendor-specific features beyond language standards. We have made efforts to disable these features to advocate standard-compliant programming practices. Solutions using these features are likely to fail compilation.

Language-specific requirements and examples
The judge system currently services solutions written in C, C++, Pascal, Java and Fortran. Details about the compilers used and supported language standards are listed in the table below. A sample solution to Problem 1000 in each language is available in the Appendix.

Language	Compiler(s)	Standard	Remark(s)
C	MS VC++ 2008 Express (“C”) and MinGW GCC 4.4.0 (“GCC”)	C99	
The macro ONLINE_JUDGE is defined.
The C99 implementation of GCC 4.4.0 is not considered feature-complete. In particular, support for variable-length arrays and intrinsic complex and imaginary types is labeled “broken”.
C++	MS VC++ 2008 Express (“C++”) and MinGW GCC 4.4.0 (“G++”)	C++98	
The macro ONLINE_JUDGE is defined.
Currently there is no plan to enable the experimental C++0x features before the new C++ standard is officially published and relatively well-supported.
Java	JDK 6 (“Java”)		
The system property ONLINE_JUDGE is set.
You should write a class named Main with public or package visibility. This Main class should contain the entry-point main method.
Pascal	FreePascal 2.2.0 (“Pascal”)	FreePascal dialect	
The macro ONLINE_JUDGE is defined.
Fortran	MinGW GCC 4.4.0 (“Fortran”)	Fortran 95	
The judging process
Access keys in the solution submission page
Access key	Page element
Alt+L	Language drop-down list
Alt+P	Problem ID field
Alt+S	Submit button
Alt+U	User ID field
(available only after you have logged in)
The judging process in a nutshell
The judging process starts with the judge system saving a submitted solution to a source file named Main with an appropriate extension. Next a designated compiler is invoked to compile the saved solution. If compilation succeeds, the judge system proceeds to run the solution on each test case available. The judging process is designed to reject-fast—once the judge system has spotted evidence to reject the solution, it exits the judging process and responds immediately.

Verdicts of the judge system
Verdict	Abbreviation	Indication
Accepted	AC	The solution has produced output that the judge system or a checker program (commonly referred to as a special judge) accepts as correct.
Presentation Error	PE	The solution has produced output that is correct in content but incorrect in format.
Time Limit Exceeded	TLE	The solution has run for longer time than permitted. This means either the time spent on all test cases exceeds the overall limit or that spent on a single test case exceeds the per-case limit. Note that time limits for solutions in Java are tripled. These solutions are also allowed an extra 110 ms for each test case.
Memory Limit Exceeded	MLE	The solution has consumed more memory than permitted.
Wrong Answer	WA	The solution has not produced the desired output.
Runtime Error	RE	The solution has caused an unhandled exception (as defined by the runtime environment) during execution.
Output Limit Exceeded	OLE	The solution has produced excessive output.
Compile Error	CE	The solution cannot be compiled into any program runnable by the judge system.
System Error		The judge system has failed to run the solution.
Validator Error		The checker program has exhibited abnormal behavior while validating the output produced by the solution.
Other questions
ISO C-conformant printf format specifiers
Prior to the compiler upgrade in May 2009, we serviced C and C++ submissions using GCC 3.4.2. That version of GCC relies on the old MS VC++ 6 runtime library, which does not support the %lld and %llu specifiers for signed and unsigned long long types but allows the standard-incompliant %lf and %lg specifiers for floating-point types. The new GCC 4.4.0 comes with its own ISO C-conformant implementation of the printf function. Now you can use %lld and %llu with either C/C++ compiler, but %lf and %lg only work with MS VC++ 2008 Express. As a rule of thumb, you should always use the %f and %g specifiers instead for floating-point types.

Unanswered questions
If you have questions unanswered in this page, feel free to post them on the web board or write to the administrators.

Appendix
Sample solutions to Problem 1000
Language	Sample solution to Problem 1000
C	
#include <stdio.h>

int main(void) {
    int a, b;
    scanf("%d%d", &a, &b);
    printf("%d", a + b);
    return 0;
}
C++	
#include <iostream>

using namespace std;

int main(void) {
    int a, b;
    cin >> a >> b;
    cout << a + b;
    return 0;
}
Java	
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        System.out.println(a + b);
    }
}
Pascal	
program p1000(Input, Output);
var
    a, b: integer;

begin
    read(a, b);
    write(a + b)
end.
Fortran	
      PROGRAM P1000

      IMPLICIT NONE
      INTEGER :: A, B

      READ(*,*) A, B
      WRITE(*, '(I0)') A + B

      END PROGRAM P1000

USTCOJ(emmm):

Frequently Asked Questions
1. What compilers does the online judge use?
The online judge runs on Debian Linux(i386) with below compilers installed:
Language	Compiler	Options
C/C++	GCC 4.4.5	-O2 -Wall -static -pipe
Pascal	FreePascal 2.4.0	-O2 -k-static
Java	Sun JDK 1.6.0	None

2. Show me how to solve a problem.
Here are sample solutions for Problem 1000
C:
/* This also shows how to use 64-bit integer. */
#include <stdio.h>
int main()
{
    long long a,b;
    while(scanf("%lld%lld",&a,&b)!=EOF) printf("%lld\n",a+b);
    return 0;
}

C++:
#include <iostream>
using namespace std;
int main()
{
    int a,b;
    while(cin>>a>>b) cout<<a+b<<endl;
    return 0;
}

Pascal:
var a,b:integer;
begin
    while(not eof(input)) do
    begin
        readln(a,b);
        writeln(a+b);
    end;
end.

Java:
import java.util.Scanner;
public class Main {
    public static void main(String[] args)
    {
        Scanner in=new Scanner(System.in);
        while (in.hasNextInt())
        {
            int a=in.nextInt();
            int b=in.nextInt();
            System.out.println(a+b);
        }
    }
}

3. What does the result in status page mean?
Result	Explanation
Waiting	You solution will be judged soon.
Compiling	The system is compiling your solution now.
Running	Your program is running. Please wait for result.
Accepted	Congratulations. Your solution is correct.
Presentation Error	Your program has produced correct answer, but with some unnecessary spaces or new lines at the end of ouput.
Wrong Answer	Your program's output doesn't match judger's answer.
Runtime Error	Your program terminated abnormally. Possible reasons are: segment fault, divided by zero or exited with code other than 0.
Time Limit Exceeded	The CPU time your program used has exceeded limit. Java has a triple time limit.
Memory Limit Exceeded	The memory your program actually used has exceeded limit.
Output Limit Exceeded	Your program has produced too much output. The limit of output is 16mb.
Compile Error	Failed to compile your source code. Click on the link to see compiler's output.
Restricted Function	Your program is trying to call a function which may harm the server. Please don't do anything other than solving the problem.
It is known that Memory Limit Exceeded and Runtime Error would be judged as Restricted Function sometimes.
System Error	Oops, something has gone wrong with the judger. Please report this to administrator.

SDIBTOJ(Oh My God):

ACM/ICPC简介及纳新
ACM/ICPC简介:
      ACM国际大学生程序设计竞赛(简称ACM-ICPC)是由国际计算机界具有悠久历史的权威性组织ACM学会(Association for Computing Machinery)主办,是世界上公认的规模最大、水平最高、参与人数最多的大学生程序设计竞赛,其宗旨是使大学生能通过计算机充分展示自己分析问题和 解决问题的能力。ACM-ICPC赛事是目前国内高校承办的唯一一项具有国际影响的计算机竞赛,受到教育界和工业界的高度重视和承认。

纳新:

如果你想深入学习编程,并且和全国最杰出的计算机程序员比赛交流,加入到这个团队里来,期待着你的加入和精彩表现!!!
你有兴趣吗?请先看看下面的几个问题:
1.你是否对程序的设计和编写有浓厚的兴趣?兴趣是坚持的动力。
2.你是否有毅力去做这件事情?训练的时间很长,短期内不会出成绩。
3.你是否有足够的心理承受力去面对失败和挫折?题目难,竞争激烈。
4.你是否能很好地与人相处?因为我们是一个团队。
      如果以上问题你都是“YES”,那么我们热烈的欢迎你的加入。信箱: sdibtacm@126.com。

大一同学第一学期如果OJ上做中文题超过150道。利用寒假到下学期初如能完成英文题1145-1191,可以直接加入集训队,有机会代表学校参加省赛和区域赛,期待你的加入。

Problem分类:
初学者(1000-1012) C语言(1500-1551)简单题(1800-1931) 数据结构(2600-2755) 算法(1288-1391) 《ACM程序设计》(1134-1192) 《挑战编程》(1013-1125) USACO Training(2300-2393)
第一届山东省赛题目(2400-2409),第三届山东省赛题目(3240-3249),第四届山东省赛题目(3230-3239),第八届山东省赛题目(3263-3273)
如果忘记密码,点击重置。

ZJUTOJ:

●What is the meaning of the judge's reply?
Here is a list of the judge's replies and their meaning: 
    Wait: The judge is so busy that it can't judge your submit at the moment, usualy you just need to wait a minute and your submit will be judged.
    Accepted : OK! Your program is correct!.
    Presentation Error : Your output format is not exactly the same as the judge's output, although your answer to the problem is correct. Check your output for spaces, blank lines,etc against the problem output specification.
    Wrong Answer : Correct solution not reached for the inputs. The inputs and outputs that we use to test the programs are not public (it is recomendable to get accustomed to a true contest dynamic ;-).
    Runtime Error : Your program failed during the execution (segmentation fault, floating point exception...). The exact cause is reported to the user.
    Time Limit Exceeded : Your program tried to run during too much time.
    Memory Limit Exceeded : Your program tried to use more memory than the judge default settings.
    Output Limit Exceeded: Your program tried to write too much information. This usually occurs if it goes into a infinite loop. Currently the output limit is 1M bytes.
    Compile Error : The compiler could not compile your ANSI program. Of course, warning messages are not error messages. Click the link at the judge reply to see the actual error message.
       Other Error :Maybe a unkown error occored in  system, please contact us!
●Why did I get a Compile Error? It's well done!
There are 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.

●What does Runtime Error stand for?
The possible cases of your encountering this error are:
    1.buffer overflow --- usually caused by a pointer reference out of range.
    2.stack overflow --- please keep in mind that the default stack size is 8192K.
    3.illegal file access --- file operations are forbidden on our judge system.
    4.Divided by 0
    5.Programme aborted before it should be finished.

●Where is the input and the output?
    Your program shall read input from stdin('Standard Input') and write output to stdout('Standard Output').For example,you can use 'scanf' in C or 'cin' in C++ to read from stdin,and use 'printf' in C or 'cout' in C++ to write to stdout.
    User programs are not allowed to open and read from/write to files, you will get a "Runtime Error" if you try to do so.
Here is a sample solution for problem 1000 using C++:
#include <iostream>
using namespace std;

int main()
{
    int a,b;
    while(cin >> a >> b&&(a||b))
        cout << a+b << endl;
}
Here is a sample solution for problem 1000 using C:
#include <stdio.h>

int main()
{
    int a,b;
    while(scanf("%d %d",&a, &b)&&(a||b))
        printf("%d\n",a+b);
}

lydsy.com:

Q:What is the compiler the judge is using and what are the compiler options?
A:The online judge system is running on Debian Linux. We are using GNU GCC/G++ for C/C++ compile, Free Pascal for pascal compile and sun-java-jdk1.6 for Java. The compile options are:
C:	gcc Main.c -o Main -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++:	g++ Main.cc -o Main -O2 -Wall -lm --static -DONLINE_JUDGE
Pascal:	fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci
Java:	javac -J-Xms32m -J-Xmx256m Main.java 
*Java has 2 more seconds and 512M more memory when running and judging.
Our compiler software version:
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
glibc 2.3.6
Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386
java version "1.6.0_22"

Q:Where is the input and the output?
A:Your program shall read input from stdin('Standard Input') and write output to stdout('Standard Output').For example,you can use 'scanf' in C or 'cin' in C++ to read from stdin,and use 'printf' in C or 'cout' in C++ to write to stdout.
User programs are not allowed to open and read from/write to files, you will get a "Runtime Error" if you try to do so.

Here is a sample solution for problem 1000 using C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
Here is a sample solution for problem 1000 using C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
Here is a sample solution for problem 1000 using PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.


Here is a sample solution for problem 1000 using Java:

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner cin = new Scanner(System.in);
		int a, b;
		while (cin.hasNext()){
			a = cin.nextInt(); b = cin.nextInt();
			System.out.println(a + b);
		}
	}
}
Q:Why did I get a Compile Error? It's well done!
A:There are 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.
Q:What is the meaning of the judge's reply XXXXX?
A:Here is a list of the judge's replies and their meaning:
Pending : The judge is so busy that it can't judge your submit at the moment, usually you just need to wait a minute and your submit will be judged.

Pending Rejudge: The test datas has been updated, and the submit will be judged again and all of these submission was waiting for the Rejudge.

Compiling : The judge is compiling your source code.
Running & Judging: Your code is running and being judging by our Online Judge.
Accepted : OK! Your program is correct!.

Presentation Error : Your output format is not exactly the same as the judge's output, although your answer to the problem is correct. Check your output for spaces, blank lines,etc against the problem output specification.

Wrong Answer : Correct solution not reached for the inputs. The inputs and outputs that we use to test the programs are not public (it is recomendable to get accustomed to a true contest dynamic ;-).

Time Limit Exceeded : Your program tried to run during too much time.

Memory Limit Exceeded : Your program tried to use more memory than the judge default settings. 

Output Limit Exceeded: Your program tried to write too much information. This usually occurs if it goes into a infinite loop. Currently the output limit is 1M bytes.

Runtime Error : All the other Error on the running phrase will get Runtime Error, such as 'segmentation fault','floating point exception','used forbidden functions', 'tried to access forbidden memories' and so on.
Compile Error : The compiler (gcc/g++/gpc) could not compile your ANSI program. Of course, warning messages are not error messages. Click the link at the judge reply to see the actual error message.

Q:How to attend Online Contests?
A:Can you submit programs for any practice problems on this Online Judge? If you can, then that is the account you use in an online contest. If you can't, then please register an id with password first.

小视野(233):

Q:What is the compiler the judge is using and what are the compiler options?
A:The online judge system is running on Ubuntu. We are using GNU GCC/G++ for C/C++ compile and Free Pascal for pascal compile. The compile options are:

C:	gcc Main.c -o Main -fno-asm -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++:	g++ Main.cc -o Main -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGE
Pascal:	fpc Main.pas -O2 -Co -Cr -Ct -Ci
Java:	javac -J-Xms32m -J-Xmx256m -encoding UTF-8 Main.java
Python:	python -c "import py_compile; py_compile.compile(r'Main.py')"
Our compiler software version:
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
g++ version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
Free Pascal Compiler version 2.4.0 [2009/12/28] for i386
Q:Where is the input and the output?
A:Your program shall read input from stdin('Standard Input') and write output to stdout('Standard Output').For example,you can use 'scanf' in C or 'cin' in C++ to read from stdin,and use 'printf' in C or 'cout' in C++ to write to stdout.
User programs are not allowed to open and read from/write to files, you will get a "Runtime Error" if you try to do so.

Here is a sample solution for problem 1000 using C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
Here is a sample solution for problem 1000 using C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
Here is a sample solution for problem 1000 using PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.
Here is a sample solution for problem 1000 using JAVA:

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        System.out.println(a + b);
    }
}
Here is a sample solution for problem 1000 using PYTHON:

print sum(int(x) for x in raw_input().split()) 
Q:Why did I get a Compile Error? It's well done!
A:There are 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.
try use #define __int64 long long when submit codes from MSVC6.0
Q:What is the meaning of the judge's reply XXXXX?
A:Here is a list of the judge's replies and their meaning:
Pending : The judge is so busy that it can't judge your submit at the moment, usually you just need to wait a minute and your submit will be judged.

Pending Rejudge: The test datas has been updated, and the submit will be judged again and all of these submission was waiting for the Rejudge.

Compiling : The judge is compiling your source code.
Running & Judging: Your code is running and being judging by our Online Judge.
Accepted : OK! Your program is correct!.

Presentation Error : Your output format is not exactly the same as the judge's output, although your answer to the problem is correct. Check your output for spaces, blank lines,etc against the problem output specification. We have deleted "Presentation Error" judgement since April 9, 2015. Answers with "Presentation Error" will be accepted. 

Wrong Answer : Correct solution not reached for the inputs. The inputs and outputs that we use to test the programs are not public (it is recomendable to get accustomed to a true contest dynamic ;-).

Time Limit Exceeded : Your program tried to run during too much time.

Memory Limit Exceeded : Your program tried to use more memory than the judge default settings. 

Output Limit Exceeded: Your program tried to write too much information. This usually occurs if it goes into a infinite loop. Currently the output limit is 1M bytes.

Runtime Error : All the other Error on the running phrase will get Runtime Error, such as 'segmentation fault','floating point exception','used forbidden functions', 'tried to access forbidden memories' and so on.
Compile Error : The compiler (gcc/g++/gpc) could not compile your ANSI program. Of course, warning messages are not error messages. Click the link at the judge reply to see the actual error message.

Q:How to attend Online Contests?
A:Can you submit programs for any practice problems on this Online Judge? If you can, then that is the account you use in an online contest. If you can't, then please register an id with password first.

leetcode:

All my solutions in the code editor suddenly went missing. How can I retrieve my solutions?
The code you typed into the code editor is stored temporarily in your browser session, however all your submitted solutions were stored permanently.

Fear not, just click on the "code" icon  to retrieve your last submitted code.

Where do I find all of my submitted codes?
Go to the submissions page, then click on the status of that submission row to view more details such as your submitted code.

submission guide
What are the environments for the programming languages of OJ?
Language	Version	Notes
C++	g++ 6.3	Uses the C++14 standard.
Java	java 1.8.0	
Python	python 2.7.12	
Python3	Python 3.5.2	
MySQL	mysql-server 5.5.44	
C	gcc 6.3	For hash table operations, you may use uthash.
"uthash.h" is included by default.
C#	mono 5.4.0	Run with /debug flag, with full support for C# 7.
JavaScript	nodejs 8.8.1	Run with --harmony flag, enabling new ES6 features.
underscore.js library is included by default.
Ruby	ruby 2.4.1	
Bash	bash 4.3.30	
Swift	swift 4.0	
Go	go 1.9.2	
Scala	Scala 2.11.6	
Kotlin	Kotlin 1.1.50	
I encountered Wrong Answer/Runtime Error for a specific test case. When I test my code using this test case, it produced the correct output as shown below. Why?
runcode result inconsistent
First, please check if you are using any global or static variables. They are Evil, period. If you must declare one, reset them in the first line of your called method or in the default constructor. Why? Because the judger executes all test cases using the same program instance, global/static variables affect the program state from one test case to another. See this Discuss thread for more details.

Are you using C or C++? If the answer is yes, chances are your code has bugs in it which cause one of the earlier test cases to trigger an undefined behavior. See this Discuss thread for an example of undefined behavior. These bugs could be hard to debug, so good luck. Or just give up on C/C++ entirely and code in a more predictable language, like Java. Just kidding.

Am I allowed to print something to stdout?
Yes. You may print to stdout for debug purposes and it will not affect the judgment of your solution. However, doing so will most likely increase the runtime of your program and you may get Time Limit Exceeded or Output Limit Exceeded due to too much extraneous output.

What does [1,null,2,3] mean in binary tree representation?
The input [1,null,2,3] represents the serialized format of a binary tree using level order traversal, where null signifies a path terminator where no node exists below. StefanPochmann made an interesting tree visualizer tool. Check out some examples below.

[]
Empty tree. The root is a reference to NULL (C/C++), null (Java/C#/Javascript), None (Python), or nil (Ruby).
[1,2,3]
       1
      / \
     2   3
[1,null,2,3]
       1
        \
         2
        /
       3
[5,4,7,3,null,2,null,-1,null,9]
       5
      / \
     4   7
    /   /
   3   2
  /   /
 -1  9
What is the difference between 'Time Limit Exceeded' and 'Timeout'?
If your solution is judged 'Time Limit Exceeded', it could be:

Your code has an underlying infinite loop.
Your algorithm is too slow and has a high time complexity.
The data structure you returned is in an invalid state. For example, a linked list that contains a cycle.
On the other hand, 'Timeout' simply means the server queue is busy and could not process your submission for the time being. Please wait for about 10 seconds and submit again.

I messed up in the code editor and would like to start from scratch on a particular problem. How do I reset to the default code definition?
Just click on the reset button  to reset your code.

I need to start another round of coding practice. Is there a way to reset the checkmarks of all solved problems?
Yes. Just go to the Session Management panel and activate a new session. Your previous session will be saved and you will start fresh. Your progress will now be tracked separately in the newly created session.

Your blog used to have great explanation of the questions and solutions. I am unable to find it anymore. Did you remove them? Is the blog archived somewhere? Can we have access that? Is it possible to bring it back?
No, it is not removed. All articles were migrated to http://articles.leetcode.com. All old links will automatically be redirected to articles.leetcode.com, for example: http://leetcode.com/2011/11/longest-palindromic-substring-part-ii.html

ZOJ:

Q:What is the compiler the judge is using and what are the compiler options?
A:The online judge system is running on Linux. We are using GNU GCC/G++ for C/C++, Free Pascal for Pascal and Sun JDK 1.6 for Java. The compile options are:
C: gcc foo.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGE
C++: g++ foo.c -o foo -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGE
Free Pascal(FPC): fpc -Sd -O2 -Op2 -dONLINE_JUDGE
Java: No special options
Our compiler software version:
gcc/g++ 4.7.2 (Debian 4.7.2-5)
GNU C Library (Debian EGLIBC 2.13-38+deb7u6)
Free Pascal Compiler version 2.6.0-9 [2013/04/14] for x86_64
java version "1.7.0_40"
Python 2.7.3
perl 5, version 14, subversion 2 (v5.14.2)
Scheme Guile 1.8.8
PHP 5.4.4-14+deb7u5 (cli)
Q:Free Pascal Runtime Error Numbers
A:Refer to here http://www.freepascal.org/docs-html/user/node16.html for detailed runtime error informations.
We list some frequently used error numbers here:
200 Division by zero
201 Range check error
202 Stack overflow error
203 Heap overflow error
204 Invalid pointer operation
205 floating point overflow
206 floating point underflow
207 invalid floating point operation
216 General Protection fault
Q:Where is the input and the output?
A:Your program shall read input from stdin('Standard Input') and write output to stdout('Standard Output').For example,you can use 'scanf' in C or 'cin' in C++ to read from stdin,and use 'printf' in C or 'cout' in C++ to write to stdout.
User programs are not allowed to open and read from/write to files, you will get a "Runtime Error" if you try to do so.
Here is a sample solution for problem 1001 using C++:
#include <iostream>
using namespace std;

int main()
{
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
}

Here is a sample solution for problem 1001 using C:
#include <stdio.h>

int main()
{
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
    return 0;
}

Here is a sample solution for problem 1001 using PASCAL(FPC):

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.

Here is a sample solution for problem 1001 using Java:

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (in.hasNextInt()) {
			int a = in.nextInt();
			int b = in.nextInt();
			System.out.println(a + b);
		}
	}
}

Here is a sample solution for problem 1001 using Python:

import sys
for line in sys.stdin:
    a = line.split()
    print int(a[0]) + int(a[1])

Here is a sample solution for problem 1001 using PHP:

<?php
while (fscanf(STDIN, "%d%d", $a, $b) == 2) {
    print ($a + $b) . "\n";
}

Q:Why did I get a Compile Error? It's well done!
A:There are 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.
Q:What is the meaning of the judge's reply XXXXX?
A:Here is a list of the judge's replies and their meaning:
Queuing : The judge is so busy that it can't judge your submit at the moment, usualy you just need to wait a minute and your submit will be judged.

Accepted : OK! Your program is correct!.

Presentation Error : Your output format is not exactly the same as the judge's output, although your answer to the problem is correct. Check your output for spaces, blank lines,etc against the problem output specification.

Wrong Answer : Correct solution not reached for the inputs. The inputs and outputs that we use to test the programs are not public (it is recomendable to get accustomed to a true contest dynamic ;-).

Time Limit Exceeded : Your program tried to run during too much time.

Memory Limit Exceeded : Your program tried to use more memory than the judge default settings. 

Output Limit Exceeded: Your program tried to write too much information. This usually occurs if it goes into a infinite loop. Currently the output limit is 1M bytes.

Non-zero Exit Code: Your program exited returning a non-zero value to the shell. For languages such as C, this probably means you forgot to add "return 0" at the end of the program. For interpreted languages NZEC will usually mean that your program either crashed or raised an uncaught exception.

Compile Error : The compiler (gcc, g++, fpc, etc) could not compile your program. Of course, warning messages are not error messages. Click the link at the judge reply to see the actual error message.

Out Of Contest Time: this message can only appear during a contest, if a program is submitted out of contest time. 

No such problem: Either you have submitted a wrong problem id or the problem is unavailable.

Segmentation Fault : The possible cases of your encountering this error are:
1.buffer overflow --- usually caused by a pointer reference out of range.
2.stack overflow --- please keep in mind that the default stack size is 8192K.

Floating Point Error : Divide by 0

Runtime Error : See FAQ below
Q:How to submit a Java solution?
A: See the sample solution above. Basically you should submit a single source file which contains a public class Main and it should have a method with signature "public static void main(String[] args)" which is the entry of your program.
Q:Which Java classes can I use?
A: You can only use classes in those packages: java.lang, java.io, java.nio, java.math, java.util, java.text and java.net. You are not allowed to catch any Error in your try-catch, read, write or create any file, or create Socket, etc. In one word, don't do anything other than solving the problem.
Q:What does Runtime Error mean?
A: If you are using Java, please check the class signature as well as the main method signature, and don't use any class which is not allowed. If you are using other languages, your program may have executed a forbidden operation, like invoking privileged syscalls, file operation, etc. Notice that buffer overflow and stack overflow can also lead to this error.

NODEOJ:

Q:可以使用哪种编程语言?
A:目前只提供C,C++,Java和Python.

Q:如何进行读取和输出?
A:只能stdin/stdout(使用标准输入/输出),不允许读取和写入任何文件.在C/C++中可以使用scanf读取,printf输出.

Q:各种状态的含义是什么?
A:
Queuing:代码已经提交,正在等待测评
Compiling:代码正在编译
Running:编译成功,正在进行测评
Acepted:代码正确
Presentation Error:格式错误.一般来说结果是正确的,但是多输出或者少输出了空格,换行等符号
Wrong Answer:答案错误.你需要检查你的代码
Runtime Error:运行时错误.引发的原因有很多,包括但不仅限于使用未初始化的指针,数组越界,堆栈溢出,除数为零
Time Limit Exceeded:超出时间限制.可能是代码中包含死循环,也可能是算法不够优化
Memory Limit Exceeded:内存超出限制.你使用的内存太多了,可能由于使用了过大的数组,或是忘记释放使用过的内存导致内存泄漏
Output Limit Exceeded:你的输出超过标准答案的三倍
Compilation Error:编译错误.请检查代码在自己的机器上能否正常编译,以及是否选错了语言.在比赛中编译错误不会增加罚时
System Error:系统傲娇了

Q:各语言的编译选项是怎样的?
A:
C:gcc source.c -o main -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGE
C++:g++ source.cpp -o main -ansi -fno-asm -O2 -Wall -lm --static -DONLINE_JUDGE
Java:javac Main.java

Q:如何编写代码?
A:以A+B Problem为例:
C
#include <stdio.h>
int main(void)
{
    int a,b;
    scanf("%d%d",&a,&b);
    printf("%d",a+b);
    return 0;
}

C++
#include <iostream>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
    return 0;
}

Java
import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String[] args)
    {
        Scanner reader=new Scanner(System.in);
        int a,b;
        a=reader.nextInt();
        b=reader.nextInt();
        System.out.println(a+b);
    }
}

Python2.7
import sys
for line in sys.stdin:
 a = line.split() 
print int(a[0]) + int (a[1])

福大OJ:

Q:我的程序要在哪里输入和输出数据?
A:你的程序必须从stdin(基本输入)读入数据并且从stdout(基本输出)输出数据. 例如,你使用C语言的话,使用scanf输入数据,使用printf输出数据,使用C++语言的话,还可以使用cin和cout读入输出数据。
请注意,你不能进行任何文件的读写操作,否则会返回错误"Restrict Function Call"。 

Q:评测服务器的性能怎样?
A:正常情况下,在我们OJ的1000题上使用GNU C++编译器提交以下代码,评测结果为使用时间接近1秒。
#include<stdio.h>
int main()
{
    int a,b,i;
    while(scanf("%d%d",&a,&b)!=EOF)
        printf("%d\n",a+b);
    for(i=0;i<450000000;++i) ++a;
    return 0;
}

Q:本OnlineJudge提供哪些编译器?编译环境是怎么样的?
A:本OJ目前提供Microsoft Visual C/C++、GNU C/C++、Free Pascal、Java等编译器,它们的编译参数是:
GNU C: gcc Main.c -o Main.exe -ansi -fno-asm -w -lm --static -DONLINE_JUDGE
C++: g++ Main.cpp -o Main.exe -ansi -fno-asm -w -lm --static -DONLINE_JUDGE
Free Pascal(FPC): fpc Main.pas -oMain.exe -Co -Cr -Ct -Ci -dONLINE_JUDGE
Microsoft Visual C: cl Main.c -FeMain.exe -F8388608 -nologo -EHsc -MP1 -w -DONLINE_JUDGE
Microsoft Visual C++: cl Main.cpp -FeMain.exe -F8388608 -nologo -EHsc -MP1 -w -DONLINE_JUDGE
Java: javac -J-Duser.language=en Main.java

我们的服务器运行在Windows NT平台下,提供的编译器的版本分别是:
Gcc/G++ Version 3.4.5 (mingw special)
Free Pascal Compiler Version 2.2.4 [2009/04/10] for i386
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Java SDK Version 1.6.0_12


Q:为什么我得到了CE?而在我的电脑上运行的很好?
A:不同的编译器之间有一些语法的差异,请使用相应的编译器进行提交。
另外,我们的OJ对编译器所使用的资源有所限制,限制是:CPU时间5秒,内存使用128MB,如果你使用的编译器在编译你的程序时超过这个资源限制,将被判为CE。 

Q:有些题目上面有“Special Judge”是什么意思?
A:Special Judge是指本题可能有多个正确的解。你的程序的答案将被一个SPJ的检测程序检测,以判断你的程序是否正确。请注意:SPJ的题目一般不会判出PE,所以请确保你的程序输出格式正确。 

Q:我要怎么使用64-bit整形?
A:在C/C++和Pascal语言中,你可以用以下方法使用64-bit整形:
有符号64-bit整形,取值范围为:-9223372036854775808 到 9223372036854775807。
语言	GCC/G++	Pascal	VC/VC++
类型名称	long long	int64	__int64
long long
输入方法	scanf("%I64d", &x);
cin >> x;	read(x);	scanf("%I64d", &x);
cin >> x;
输出方法	printf("%I64d", x);
cout << x;	write(x);	printf("%I64d", x);
cout << x;
无符号64-bit整形,取值范围为:0 到 18446744073709551615。
语言	GCC/G++	Pascal	VC/VC++
类型名称	unsigned long long	qword	unsigned __int64
unsigned long long
输入方法	scanf("%I64u", &x);
cin >> x;	read(x);	scanf("%I64u", &x);
cin >> x;
输出方法	printf("%I64u", x);
cout << x;	write(x);	printf("%I64u", x);
cout << x;

Q:OJ返回的结果分别是什么意思?
A:以下是OJ可能返回的结果和其意义:

Accepted	OK! 你的程序是正确的。
Presentation Error	你的输出结果是正确的,但格式不正确,可能是你多输出或少输出了空格、Tab(\t)、换行(\n)等,请检查你的程序输出。
Wrong Answer	你的程序输出的结果不正确。
Time Limit Exceed	你的程序尝试使用超过题目限制的时间,可能是你的程序内存在死循环或者你的程序的算法效率太低。
Memory Limit Exceed	你的程序尝试使用超过题目限制的内存。
Restrict Function Call	你的程序尝试使用不允许的系统API,请注意,打开任意文件将被判为RFC。
Runtime Error	你的程序发生了运行时错误。可能是由于除于0、内存访问违规等运行时问题。
Compile Error	你的程序不能通过编译,请点击该结果可以查看编译器提示。
Output Limit Exceed	你的程序的输出超过了系统限制。请检查你的程序是否存在死循环问题。目前系统的限制是8MB。
Judging	你的程序正在评测当中,请稍候。
Queuing	OJ正在评测其它用户的提交,请你稍等片刻。
System Error	未知错误,如果有该评测结果,请及时联系管理员。
注意:对于Java语言,有极少部分可能将RFC与RE判成WA。 

Q:1000题怎么解答?
A:以下是1000题的各种语言的参考程序:
C++语言:
#include <iostream>
using namespace std;
int main()
{
  int a,b;
  while (cin>>a>>b) cout<<a+b<<endl;
  return 0;
}
C语言:
#include <stdio.h>
int main()
{
  int a,b;
  while (scanf("%d%d",&a,&b)!=EOF) 
    printf("%d\n",a+b);
  return 0;
}
PASCAL语言:
var
  a,b:integer;
begin
  while not eof do begin
    readln(a,b);
    writeln(a+b);
  end;
end.
Java语言:
import java.io.*;
import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
		Scanner cin = new Scanner ( System.in );
		int a,b;
		while(cin.hasNext())
		{
			a=cin.nextInt();
			b=cin.nextInt();
			System.out.println(a+b);
		}

	}
}

MoFriend OJ:

Q:这个在线裁判系统使用什么样的编译器和编译选项?
A:系统运行于Debian/Ubuntu Linux. 使用GNU GCC/G++ 作为C/C++编译器, Free Pascal 作为pascal 编译器 ,用 sun-java-jdk1.6 编译 Java. 对应的编译选项如下:
C:	gcc Main.c -o Main -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++:	g++ Main.cc -o Main -O2 -Wall -lm --static -DONLINE_JUDGE
Pascal:	fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci
Java:	javac -J-Xms32m -J-Xmx256m Main.java 
*Java has 2 more seconds and 512M more memory when running and judging.
编译器版本为(系统可能升级编译器版本,这里直供参考):
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
glibc 2.3.6
Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386
java version "1.6.0_22"

Q:程序怎样取得输入、进行输出?
A:你的程序应该从标准输入 stdin('Standard Input')获取输出 并将结果输出到标准输出 stdout('Standard Output').例如,在C语言可以使用 'scanf' ,在C++可以使用'cin' 进行输入;在C使用 'printf' ,在C++使用'cout'进行输出.

用户程序不允许直接读写文件, 如果这样做可能会判为运行时错误 "Runtime Error"。

下面是 1000题的参考答案

C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.


Java:

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner cin = new Scanner(System.in);
		int a, b;
		while (cin.hasNext()){
			a = cin.nextInt(); b = cin.nextInt();
			System.out.println(a + b);
		}
	}
}
Q:为什么我的程序在自己的电脑上正常编译,而系统告诉我编译错误!
A:GCC的编译标准与VC6有些不同,更加符合c/c++标准:
main 函数必须返回int, void main 的函数声明会报编译错误。
i 在循环外失去定义 "for(int i=0...){...}"
itoa 不是ansi标准函数.
__int64 不是ANSI标准定义,只能在VC使用, 但是可以使用long long声明64位整数。
如果用了__int64,试试提交前加一句#define __int64 long long
Q:系统返回信息都是什么意思?
A:详见下述:
Pending : 系统忙,你的答案在排队等待.

Pending Rejudge: 因为数据更新或其他原因,系统将重新判你的答案.

Compiling : 正在编译.
Running & Judging: 正在运行和判断.
Accepted : 程序通过!

Presentation Error : 答案基本正确,但是格式不对。

Wrong Answer : 答案不对,仅仅通过样例数据的测试并不一定是正确答案,一定还有你没想到的地方.

Time Limit Exceeded : 运行超出时间限制,检查下是否有死循环,或者应该有更快的计算方法。

Memory Limit Exceeded : 超出内存限制,数据可能需要压缩,检查内存是否有泄露。

Output Limit Exceeded: 输出超过限制,你的输出比正确答案长了两倍.

Runtime Error : 运行时错误,非法的内存访问,数组越界,指针漂移,调用禁用的系统函数。请点击后获得详细输出。
Compile Error : 编译错误,请点击后获得编译器的详细输出。

Q:如何参加在线比赛?
A:注册 一个帐号,然后就可以练习,点击比赛列表Contests可以看到正在进行的比赛并参加。

USTCOJ:

Frequently Asked Questions
1. What compilers does the online judge use?
The online judge runs on Debian Linux(i386) with below compilers installed:
Language	Compiler	Options
C/C++	GCC 4.4.5	-O2 -Wall -static -pipe
Pascal	FreePascal 2.4.0	-O2 -k-static
Java	Sun JDK 1.6.0	None

2. Show me how to solve a problem.
Here are sample solutions for Problem 1000
C:
/* This also shows how to use 64-bit integer. */
#include <stdio.h>
int main()
{
    long long a,b;
    while(scanf("%lld%lld",&a,&b)!=EOF) printf("%lld\n",a+b);
    return 0;
}

C++:
#include <iostream>
using namespace std;
int main()
{
    int a,b;
    while(cin>>a>>b) cout<<a+b<<endl;
    return 0;
}

Pascal:
var a,b:integer;
begin
    while(not eof(input)) do
    begin
        readln(a,b);
        writeln(a+b);
    end;
end.

Java:
import java.util.Scanner;
public class Main {
    public static void main(String[] args)
    {
        Scanner in=new Scanner(System.in);
        while (in.hasNextInt())
        {
            int a=in.nextInt();
            int b=in.nextInt();
            System.out.println(a+b);
        }
    }
}

3. What does the result in status page mean?
Result	Explanation
Waiting	You solution will be judged soon.
Compiling	The system is compiling your solution now.
Running	Your program is running. Please wait for result.
Accepted	Congratulations. Your solution is correct.
Presentation Error	Your program has produced correct answer, but with some unnecessary spaces or new lines at the end of ouput.
Wrong Answer	Your program's output doesn't match judger's answer.
Runtime Error	Your program terminated abnormally. Possible reasons are: segment fault, divided by zero or exited with code other than 0.
Time Limit Exceeded	The CPU time your program used has exceeded limit. Java has a triple time limit.
Memory Limit Exceeded	The memory your program actually used has exceeded limit.
Output Limit Exceeded	Your program has produced too much output. The limit of output is 16mb.
Compile Error	Failed to compile your source code. Click on the link to see compiler's output.
Restricted Function	Your program is trying to call a function which may harm the server. Please don't do anything other than solving the problem.
It is known that Memory Limit Exceeded and Runtime Error would be judged as Restricted Function sometimes.
System Error	Oops, something has gone wrong with the judger. Please report this to administrator.

HDOJ:

Q What does "HDOJ" stand for ?
A HDOJ is short for Hangzhou Dianzi University Online Judge which was founded in September 2005 and has the lastest version of 3.0.
Q Which programming languages can I use at Online Judge ?
A C, C++, Pascal and Java are currently supported at Online Judge.
Q How to write a solution using my favourite programming language ?
A You can find the answer in corresponding section:
How to write Java solutions
How to write C/C++ solutions
How to write Pascal solutions
Q Is there any way to determine if my program is runned at Online Judge or not ?
A There is a conditional define of compiler called ONLINE_JUDGE. Example of using:

C/C++
#ifdef ONLINE_JUDGE
    running on online judge
#endif
Pascal
{$IFDEF ONLINE_JUDGE}
    running on online judge
{$ENDIF}
Q What kind of input and output can I use at Online Judge ?
A Only stdin (standard input) and stdout (standard output) can be used. For instance, you can use scanf in C or cin in C++ to read, and printf in C or cout in C++ to write. Your programs are NOT allowed to open and read from / write to files. You will probably get a Runtime Error or Wrong Answer if you try to do so.
Besides, you should note that, in most cases, C runtime I/O functions are more effective than those of C++'s, so scanf and printf is recommended to process huge input or output.
Q What are the meanings of the judge's replies
A Here is a list of the Judge's replies and their meaning:

Queuing: The judge is so busy that it can't judge your solution at the moment. Usually you just need to wait a while because our judge server is powered by IBM and Intel Xeon :-)
Compiling : Your solution is being compiled to binary form by specified compiler.
Running : Your program is running on the server and fed with input data if necessary.
Accepted (AC) : Yes, your program is correct. You did a good job!
Presentation Error (PE) : Your program's output format is not exactly the same as required by the problem, although the output is correct. This usually means the existence of omitted or extra blank characters (white spaces, tab characters and/or new line characters) between any two non-blank characters, and/or blank lines (a line consisting of only blank characters) between any two non-blank lines. Trailing blank characters at the end of each line and trailing blank lines at the of output are not considered format errors. Check the output for spaces, blank lines, etc. against the problem's output specification.
Wrong Answer (WA) : Correct solution not reached for the inputs. The inputs and outputs that we use to test the programs are not public (it is recomendable to get accustomed to a true contest dynamic :-)
Runtime Error (RE) : Your program failed during the execution and you will receive the hints for the reasons. Here are part of the hints and their meanings.
ACCESS_VIOLATION Your program tried to read from or write to a address for which it does not have the appropriate access.
ARRAY_BOUNDS_EXCEEDED Your program tried to access an array element that is out of bounds and the underlying hardware supports bounds checking.
FLOAT_DENORMAL_OPERAND One of the operands in a floating-point operation is denormal. A denormal value is one that is too small to represent as a standard floating-point value.
FLOAT_DIVIDE_BY_ZERO The thread tried to divide a floating-point value by a floating-point divisor of zero.
FLOAT_OVERFLOW The exponent of a floating-point operation is greater than the magnitude allowed by the corresponding type.
FLOAT_UNDERFLOW The exponent of a floating-point operation is less than the magnitude allowed by the corresponding type.
INTEGER_DIVIDE_BY_ZERO Your program tried to divide an integer value by an integer divisor of zero.
INTEGER_OVERFLOW The result of an integer operation caused a carry out of the most significant bit of the result.
STACK_OVERFLOW Your program used up its stack.
...... Other runtime errors.
Time Limit Exceeded (TLE) : Your program tried to run during too much time.
Memory Limit Exceeded (MLE) : Your program tried to use more memory than the judge default settings.
Output Limit Exceeded (OLE) : Your program tried to write too much information. This usually occurs if it goes into a infinite loop.
Compilation Error (CE) : The compiler fails to compile your program. Warning messages are not considered errors. Click on the judge's reply to see the warning and error messages produced by the compiler.
System Error: The judge cannot run your program. One example is that your program requires much more memory than hardware limitation.
Out Of Contest Time : This message can only appear during a contest, if a program is submitted out of contest time.
Q What does "Special Judge" mean ?
A When a problem has multiple acceptable answers, a special judge program is needed. The special judge program uses the input data and some other information to check your program's output and returns the result to the judge.
Q My program got an AC in C++ while TLE in G++ !
A This mostly occurs in the case that your program have to process huge input. As we known, MS-VC++ is more effective to process I/O althrough we have tried our best to reduce the difference. This can hardly occur because we have tested most of the test cases in both C++ and G++ before we publish a problem on condition that you solve the problem with correct algorithms.
Q I'm sure that my program is incorrect but I still got an AC !
A Maybe our test cases are not strong enough to catch the bugs in your program. Please let us know.
Q How can I participate in online contests ?
A There are two kinds of online contests at HDOJ. One is public and the other is private. Everyone who has an account of HDOJ can participate in a public contest, but only specified ones who had been invited to the contests can take part in a private one.
To participate in the public contests, you should register an account first if you don't own one, then use your account and password to log in the contest.
To participate private ones, your should use the id and password supplied by the organizer for login.
Q Can I arrange a contest at HDOJ ?
A If you want to arrange a programming contest, and you don't have enough equipments or time to setup an automated judge, HDOJ will be pleased to host the contest for you.
What you need to setup your own contest are:
A problem set with test cases.
The list of the teams who will participate in the Contest. This can be omitted if the contest is a public one but necessary for a private one.
The date for the contest (GMT+8).
Send the stuff above to lcy@hdu.edu.cn by email and wait for our reply. If your apply is accepted, your contest will be arranged in HDOJ's contests schedule.
Q How to use 64-bit integer types ?
A Server supports signed and unsigned 64-bit integers.
Signed 64-bit integer. Value range: -9223372036854775808 .. 9223372036854775807.
Language	GCC/G++	Pascal	C/C++
Type name	__int64
or
long long	int64	__int64
Input	scanf("%I64d", &x);
or
cin >> x;	read(x);	scanf("%I64d", &x);
Output	printf("%I64d", x);	cout << x; write(x);	printf("%I64d", x);
Unsigned 64-bit integer. Value range: 0 .. 18446744073709551615.
Language	GCC/G++	Pascal	C/C++
Type name	unsigned __int64
or
unsigned long long
qword	unsigned __int64
Input	scanf("%I64u", &x);
or
cin >> x;	read(x);	scanf("%I64u", &x);
Output	printf("%I64u", x);
or cout << x;	write(x);	printf("%I64u", x);
Q How can I read input data until the end of file ?
A You can do it for example like this:
Language	C	C++	Pascal
To read numbers	int n;
while(scanf("%d", &n) != EOF)
{
  ...
}
int n;
while (cin >> n)
{
  ...
}
var n: integer;
...
while not seekeof do
begin
  read(n);
  ...
end;
To read characters	int c;
while ((c = getchar()) != EOF)
{
  ...
}
char c;
while (cin.get(c))
{
  ...
}
var c: char;
...
while not eof do
begin
  read(c); 
  ...
end;
To read lines	char line[1024];
while(gets(line))
{
  ...
}
string line;
while (getline(cin, line))
{
  ...
}
var line: string;
...
while not eof do
begin
  readln(line);
  ...
end;
Q What is the maximal size of program that can be submitted ?
A The maximal size of program is 65535 characters.
HZNUOJ:
环境参数
系统运行于Ubuntu 14.04 对应的编译器和编译选项如下:

语言	编译器版本	编译选项
C	gcc 4.8.4	gcc Main.c -o Main -fno-asm -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++	g++ 4.8.4	g++ Main.cc -o Main -fno-asm -O2 -Wall -lm --static -std=c++11 -DONLINE_JUDGE
Pascal	Free Pascal 2.6.2	fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci
Java	openjdk 1.7.0_79	javac -J-Xms32m -J-Xmx256m Main.java (Languages except C/C++ has 2 more seconds and 128M more memory when running and judging.)
Ruby	1.9.3	
Bash	4.3.11	
Python2	2.7.6	
Python3	3.4.3	
PHP	7.0	
Perl	perl 5 version 18	
C#	mono 3.2.8	
Lua	5.2.3	
例题示范
你的程序应该从标准输入 stdin('Standard Input')获取输出 并将结果输出到标准输出 stdout('Standard Output').例如,在C语言可以使用 scanf ,在C++可以使用cin 进行输入;在C使用printf ,在C++使用cout进行输出. 用户程序不允许直接读写文件, 如果这样做可能会判为运行时错误 "Runtime Error"。 详见1000题hint中各种语言的参考答案。

测评结果释义
评测结果	缩写	含义
Pending	PD	您的提交正排队等待评测。
Pending Rejudge	PR	因为数据更新或其他原因,系统将重新判你的答案。
Compiling	CP	您提交的代码正在被编译。
Running & Judging	RN	您的程序正在运行。
Judging	JG	我们 正在检查您程序的输出是否正确。
Accepted	AC	恭喜!您的程序通过了所有数据!
Presentation Error	PE	您的程序输出有格式问题,请检查是否多了或者少了空格 (' ')、制表符('\t')或者换行符('\n')
Wrong Answer	WA	您的程序输出结果错误。
Runtime Error	RE	您的程序在运行时发生错误。
Time Limit Exceeded	TLE	您的程序运行的时间已经超出了题目的时间限制。
Memory Limit Exceeded	MLE	您的程序运行的内存已经超出了题目的内存限制。
Output Limit Exceeded	OLE	您的程序输出内容太多,超过了这个题目的输出限制。(一般输出超过答案2倍时会触发,强制终止程序,防止恶意输出对硬盘造成压力)
Compile Error	CE	您的程序语法出现问题,编译器无法编译。
System Error	SE	评判系统内部出现错误 ,我们会尽快处理。
Out Of Contest Time	OCT	考试已经结束,不再评测提交。
常见编译问题
有的时候你的程序在本地能编译通过,但提交OJ后却显示编译错误。

这多见于C/C++,一般是因为你本地用的是VS,VS的编译器是MS-VC++,而OJ用的是G++,这两个编译器的标准略有不同,G++更符合标准,下面列出一些常见的导致CE原因:

main 函数必须返回int, void main() 的函数声明会报编译错误。
itoa 不是ansi标准函数.
__int64 不是ANSI标准定义,只能在VC使用, 但是可以使用long long声明64位整数。
如果你使用JAVA语言,请注意类名一定要是Main, 否则也会返回CE。

比赛相关
比赛的类型
目前HZNUOJ有四种类型的比赛:

practice,练习赛,只是简单的把题目归个类做做练习,相应题目不会从problemset中隐藏,且通过后可以立即进入题目的status里查看别人的代码。
public,公开的比赛,任何人均可进入参加。
password,设有密码保护的比赛,只有输入正确密码才能进入。
special,特殊比赛,只有使用专门发放的账号才能进入。
比赛赛制
HZNUOJ所有类型的比赛均为ACM/ICPC赛制。

每场比赛设有若干道题目,比赛开始后,参赛者需在时限内去解决这些题目。

每场比赛都设有实时榜单,榜单排名规则也与ACM/ICPC相同。

ACM/ICPC排名规则
每题耗时:Accepted的那一刻距离比赛开始的时间。

总罚时:所有AC了的题的(耗时+错误次数*20min)的和。

排名时,AC题数优先,题数相同时按罚时排序。 

有些比较正式的比赛设有封榜机制,即比赛最后一段时间内的提交结果将隐藏(除了自己都不可见),榜单也会停止更新,新的提交会显示为灰色,留作最后滚榜用。

滚榜机制介绍
滚榜是ACM/ICPC系列比赛中一个十分具有特色的机制。

在正规ACM/ICPC系列比赛中,比赛最后一个小时的提交结果是隐藏的,只有选手本人能看到,在榜单上会显示成代表未知的灰色,以增加比赛紧张气氛。

然后在颁奖会上,将从榜单最后一名开始,一个个揭晓灰色的未知提交,一旦揭晓的结果为通过,这个人的排名就会上升,否则这个人的排名确定,开始揭晓下一个人,以此类推。这样一来,可以从后往前一个个确定最终排名,一旦名次达到获奖名次内,可以直接进行颁奖。整个过程惊险刺激,是整个比赛的亮点所在。

题目相关
HZNUOJ的所有题目均在ProblemSet 中,每个题目都有一个唯一的数字编号,称为Problem ID。

每当你AC了一道题,你就有权限查看这题所有的提交代码,借鉴参考大神们的写法,从而更上一层楼。

比赛的所有题目,都是从ProblemSet中选出来的,是它的子集。

当一道题被选入某个非practice模式的比赛中之后,为公平起见,它会在ProblemSet中被隐藏掉,在比赛结束后恢复。

一般如果题目突然不见了,可能就是这个原因,当然也有可能是因为其他原因而被管理员手动隐藏了。

当然,一般比赛的题都是新出的,比赛结束后才第一次在ProblemSet中露面。

选入比赛中的题目,在比赛界面中,会隐藏掉原来的Problem ID,取而代之的是A, B, C...的代号。在比赛结束后,会在标题旁边显示真正的Problem ID,可以点击前往ProblemSet补题。

积分规则
HZNUOJ的ProblemSet中设有一个榜单,积分和等级的计算规则如下。

等级由实力(Strength)决定,当实力达到一定值后自然会升级,而实力又从刷题中来,每道题后面均标有分数(Scores),代表AC这道题之后能提升多少实力。一般来说,越少人做的题目,分数越高,一起刷题的人越多,每道题的分数也越高。需要说明的是,用户的实力值是会根据大环境动态变化的(其实是因为分数在动态变化),如果你AC的题目被更多人AC出来了,你的实力值会下降,另外一方面,OJ内有更多强者涌入的时候,你的实力值也会提升。所以,想要快速升级,那就多刷题,刷难题!

等级划分与小说《斗破苍穹》一致,自低向高分别为斗之气、斗者、斗师、大斗师、斗灵、斗王、斗皇、斗宗、斗尊、斗圣、斗帝,除斗帝外,每一阶又分不同等级,阶数越高,升级越困难。除此之外,每一阶还有不同的代表颜色,该阶等级越高,颜色越深。

小白菜OJ(输入法打出洗笔池真是奇怪):

Q:这个在线裁判系统使用什么样的编译器和编译选项?
A:系统运行于Debian/Ubuntu Linux. 使用GNU GCC/G++ 作为C/C++编译器, Free Pascal 作为pascal 编译器 ,用 openjdk-7 编译 Java. 对应的编译选项如下:
C:	gcc Main.c -o Main -fno-asm -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++:	g++ -fno-asm -Wall -lm -O2 --static -DONLINE_JUDGE -o Main Main.cc
Pascal:	fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci
Java:	javac -J-Xms32m -J-Xmx256m Main.java 
*Java has 2 more seconds and 512M more memory when running and judging.
编译器版本为(系统可能升级编译器版本,这里直供参考):
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
glibc 2.3.6
Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386
java version "1.6.0_22"

Q:程序怎样取得输入、进行输出?
A:你的程序应该从标准输入 stdin('Standard Input')获取输入,并将结果输出到标准输出 stdout('Standard Output').例如,在C语言可以使用 'scanf' ,在C++可以使用'cin' 进行输入;在C使用 'printf' ,在C++使用'cout'进行输出.

用户程序不允许直接读写文件, 如果这样做可能会判为运行时错误 "Runtime Error"。

下面是 1000题的参考答案

C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.


Java:

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner cin = new Scanner(System.in);
		int a, b;
		while (cin.hasNext()){
			a = cin.nextInt(); b = cin.nextInt();
			System.out.println(a + b);
		}
	}
}
Q:为什么我的程序在自己的电脑上正常编译,而系统告诉我编译错误!
A:GCC的编译标准与VC6有些不同,更加符合c/c++标准:
main 函数必须返回int, void main 的函数声明会报编译错误。
i 在循环外失去定义 "for(int i=0...){...}"
itoa 不是ansi标准函数.
__int64 不是ANSI标准定义,只能在VC使用, 但是可以使用long long声明64位整数。
如果用了__int64,试试提交前加一句#define __int64 long long
Q:系统返回信息都是什么意思?
A:详见下述:
Pending : 系统忙,你的答案在排队等待.

Pending Rejudge: 因为数据更新或其他原因,系统将重新判你的答案.

Compiling : 正在编译.
Running & Judging: 正在运行和判断.
Accepted : 程序通过!

Presentation Error : 答案基本正确,但是格式不对。

Wrong Answer : 答案不对,仅仅通过样例数据的测试并不一定是正确答案,一定还有你没想到的地方.

Time Limit Exceeded : 运行超出时间限制,检查下是否有死循环,或者应该有更快的计算方法。

Memory Limit Exceeded : 超出内存限制,数据可能需要压缩,检查内存是否有泄露。

Output Limit Exceeded: 输出超过限制,你的输出比正确答案长了两倍.

Runtime Error : 运行时错误,非法的内存访问,数组越界,指针漂移,调用禁用的系统函数。请点击后获得详细输出。
Compile Error : 编译错误,请点击后获得编译器的详细输出。

Q:如何参加在线比赛?
A:注册 一个帐号,然后就可以练习,点击比赛列表Contests可以看到正在进行的比赛并参加。

XYNUOJ:

Q:这个在线裁判系统使用什么样的编译器和编译选项?
A:系统运行于Debian/Ubuntu Linux. 使用GNU GCC/G++ 作为C/C++编译器, Free Pascal 作为pascal 编译器 ,用 openjdk-7 编译 Java. 对应的编译选项如下:
C:	gcc Main.c -o Main -fno-asm -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++:	g++ -fno-asm -Wall -lm --static -std=c++11 -DONLINE_JUDGE -o Main Main.cc
Pascal:	fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci
Java:	javac -J-Xms32m -J-Xmx256m Main.java 
*Java has 2 more seconds and 512M more memory when running and judging.
编译器版本为(系统可能升级编译器版本,这里直供参考):
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
glibc 2.3.6
Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386
java version "1.6.0_22"

Q:程序怎样取得输入、进行输出?
A:你的程序应该从标准输入 stdin('Standard Input')获取输入,并将结果输出到标准输出 stdout('Standard Output').例如,在C语言可以使用 'scanf' ,在C++可以使用'cin' 进行输入;在C使用 'printf' ,在C++使用'cout'进行输出.

用户程序不允许直接读写文件, 如果这样做可能会判为运行时错误 "Runtime Error"。

下面是 1209题的参考答案

C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.


Java:

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner cin = new Scanner(System.in);
		int a, b;
		while (cin.hasNext()){
			a = cin.nextInt(); b = cin.nextInt();
			System.out.println(a + b);
		}
	}
}
Q:为什么我的程序在自己的电脑上正常编译,而系统告诉我编译错误!
A:GCC的编译标准与VC6有些不同,更加符合c/c++标准:
main 函数必须返回int, void main 的函数声明会报编译错误。
i 在循环外失去定义 "for(int i=0...){...}"
itoa 不是ansi标准函数.
__int64 不是ANSI标准定义,只能在VC使用, 但是可以使用long long声明64位整数。
如果用了__int64,试试提交前加一句#define __int64 long long
Q:系统返回信息都是什么意思?
A:详见下述:
Pending : 系统忙,你的答案在排队等待.

Pending Rejudge: 因为数据更新或其他原因,系统将重新判你的答案.

Compiling : 正在编译.
Running & Judging: 正在运行和判断.
Accepted : 程序通过!

Presentation Error : 答案基本正确,但是格式不对。

Wrong Answer : 答案不对,仅仅通过样例数据的测试并不一定是正确答案,一定还有你没想到的地方.

Time Limit Exceeded : 运行超出时间限制,检查下是否有死循环,或者应该有更快的计算方法。

Memory Limit Exceeded : 超出内存限制,数据可能需要压缩,检查内存是否有泄露。

Output Limit Exceeded: 输出超过限制,你的输出比正确答案长了两倍.

Runtime Error : 运行时错误,非法的内存访问,数组越界,指针漂移,调用禁用的系统函数。请点击后获得详细输出。
Compile Error : 编译错误,请点击后获得编译器的详细输出。

Q:如何参加在线比赛?
A:注册 一个帐号,然后就可以练习,点击比赛列表Contests可以看到正在进行的比赛并参加。

NUAAOJ:

Welcome to Nuaa Online Judge.
// 完结撒花(???)

浦江慧OJ:

Q:这个在线裁判系统使用什么样的编译器和编译选项?
A:系统运行于Debian/Ubuntu Linux. 使用GNU GCC/G++ 作为C/C++编译器, Free Pascal 作为pascal 编译器 ,用 openjdk-7 编译 Java. 对应的编译选项如下:
C:	gcc Main.c -o Main -fno-asm -Wall -lm --static -std=c99 -DONLINE_JUDGE
#pragma GCC optimize ("O2")
可以手工开启O2优化
C++:	g++ -fno-asm -Wall -lm --static -std=c++11 -DONLINE_JUDGE -o Main Main.cc
Pascal:	fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci
Java:	javac -J-Xms32m -J-Xmx256m Main.java 
*Java has 2 more seconds and 512M more memory when running and judging.
编译器版本为(系统可能升级编译器版本,这里仅供参考):
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
glibc 2.19
Free Pascal Compiler version 2.6.2
openjdk 1.7.0_151

Q:程序怎样取得输入、进行输出?
A:你的程序应该从标准输入 stdin('Standard Input')获取输入,并将结果输出到标准输出 stdout('Standard Output').例如,在C语言可以使用 'scanf' ,在C++可以使用'cin' 进行输入;在C使用 'printf' ,在C++使用'cout'进行输出.

用户程序不允许直接读写文件, 如果这样做可能会判为运行时错误 "Runtime Error"。

下面是 1000题的参考答案

C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
    return 0;
}
C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
    return 0;
}
PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.


Java:

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner cin = new Scanner(System.in);
		int a, b;
		while (cin.hasNext()){
			a = cin.nextInt(); b = cin.nextInt();
			System.out.println(a + b);
		}
	}
}
Q:为什么我的程序在自己的电脑上正常编译,而系统告诉我编译错误!
A:GCC的编译标准与VC6有些不同,更加符合c/c++标准:
main 函数必须返回int, void main 的函数声明会报编译错误。
i 在循环外失去定义 "for(int i=0...){...}"
itoa 不是ansi标准函数.
__int64 不是ANSI标准定义,只能在VC使用, 但是可以使用long long声明64位整数。
如果用了__int64,试试提交前加一句#define __int64 long long, scanf和printf 请使用%lld作为格式
Q:系统返回信息都是什么意思?
A:详见下述:
Pending : 系统忙,你的答案在排队等待.

Pending Rejudge: 因为数据更新或其他原因,系统将重新判你的答案.

Compiling : 正在编译.
Running & Judging: 正在运行和判断.
Accepted : 程序通过!

Presentation Error : 答案基本正确,但是格式不对。

Wrong Answer : 答案不对,仅仅通过样例数据的测试并不一定是正确答案,一定还有你没想到的地方.

Time Limit Exceeded : 运行超出时间限制,检查下是否有死循环,或者应该有更快的计算方法。

Memory Limit Exceeded : 超出内存限制,数据可能需要压缩,检查内存是否有泄露。

Output Limit Exceeded: 输出超过限制,你的输出比正确答案长了两倍.

Runtime Error : 运行时错误,非法的内存访问,数组越界,指针漂移,调用禁用的系统函数。请点击后获得详细输出。
Compile Error : 编译错误,请点击后获得编译器的详细输出。

有渔OJ(雷同.jpg):

Q:这个在线裁判系统使用什么样的编译器和编译选项?
A:系统运行于Debian/Ubuntu Linux. 使用GNU GCC/G++ 作为C/C++编译器, Free Pascal 作为pascal 编译器 ,用 openjdk-7 编译 Java. 对应的编译选项如下:
C:	gcc Main.c -o Main -fno-asm -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++:	g++ -fno-asm -Wall -lm --static -std=c++11 -DONLINE_JUDGE -o Main Main.cc
Pascal:	fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci
Java:	javac -J-Xms32m -J-Xmx256m Main.java 
*Java has 2 more seconds and 512M more memory when running and judging.
编译器版本为(系统可能升级编译器版本,这里直供参考):
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
glibc 2.3.6
Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386
java version "1.6.0_22"

Q:程序怎样取得输入、进行输出?
A:你的程序应该从标准输入 stdin('Standard Input')获取输入,并将结果输出到标准输出 stdout('Standard Output').例如,在C语言可以使用 'scanf' ,在C++可以使用'cin' 进行输入;在C使用 'printf' ,在C++使用'cout'进行输出.

用户程序不允许直接读写文件, 如果这样做可能会判为运行时错误 "Runtime Error"。

下面是 1000题的参考答案

C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.


Java:

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner cin = new Scanner(System.in);
		int a, b;
		while (cin.hasNext()){
			a = cin.nextInt(); b = cin.nextInt();
			System.out.println(a + b);
		}
	}
}
Q:为什么我的程序在自己的电脑上正常编译,而系统告诉我编译错误!
A:GCC的编译标准与VC6有些不同,更加符合c/c++标准:
main 函数必须返回int, void main 的函数声明会报编译错误。
i 在循环外失去定义 "for(int i=0...){...}"
itoa 不是ansi标准函数.
__int64 不是ANSI标准定义,只能在VC使用, 但是可以使用long long声明64位整数。
如果用了__int64,试试提交前加一句#define __int64 long long
Q:系统返回信息都是什么意思?
A:详见下述:
Pending : 系统忙,你的答案在排队等待.

Pending Rejudge: 因为数据更新或其他原因,系统将重新判你的答案.

Compiling : 正在编译.
Running & Judging: 正在运行和判断.
Accepted : 程序通过!

Presentation Error : 答案基本正确,但是格式不对。

Wrong Answer : 答案不对,仅仅通过样例数据的测试并不一定是正确答案,一定还有你没想到的地方.

Time Limit Exceeded : 运行超出时间限制,检查下是否有死循环,或者应该有更快的计算方法。

Memory Limit Exceeded : 超出内存限制,数据可能需要压缩,检查内存是否有泄露。

Output Limit Exceeded: 输出超过限制,你的输出比正确答案长了两倍.

Runtime Error : 运行时错误,非法的内存访问,数组越界,指针漂移,调用禁用的系统函数。请点击后获得详细输出。
Compile Error : 编译错误,请点击后获得编译器的详细输出。

BJTUOJ(旧):

Q:这个在线裁判系统使用什么样的编译器和编译选项?
A:系统运行于Ubuntu Linux. 使用GNU GCC/G++ 作为C/C++编译器,,用 openjdk-8 编译 Java. 对应的编译选项如下:
C:	gcc Main.c -o Main -fno-asm -O2 -Wall -lm --static -std=c11 -DONLINE_JUDGE
C++:	g++ -fno-asm -Wall -O2 -lm --static -std=c++11 -DONLINE_JUDGE -o Main Main.cc
Java:	javac -J-Xms64m -J-Xmx128m Main.java 
*Java has 2 more seconds and 512M more memory when running and judging.
编译器版本为(系统可能升级编译器版本,此处仅供参考):
gcc 5.4.0
glibc 2.23
java version "1.8.0_121"

Q:程序怎样取得输入、进行输出?
A:你的程序应该从标准输入 stdin('Standard Input')获取输入,并将结果输出到标准输出 stdout('Standard Output').例如,在C语言可以使用 'scanf' ,在C++可以使用'cin' 进行输入;在C使用 'printf' ,在C++使用'cout'进行输出.

用户程序不允许直接读写文件, 如果这样做可能会判为运行时错误 "Runtime Error"。

下面是 1000题的参考答案

C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
Java:

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner cin = new Scanner(System.in);
		int a, b;
		while (cin.hasNext()){
			a = cin.nextInt(); b = cin.nextInt();
			System.out.println(a + b);
		}
	}
}
python2:

#!/usr/bin/python2  // tell the judge system using python2, default is python3
#coding=utf-8
while True:
    try:
        a = 0
        for x in raw_input().split():
            a += int(x)
        print a
    except EOFError as e:
        break
python3:

#coding=utf-8
while True:
    try:
        a = 0
        for x in input().split():
            a += int(x)
        print(a)
    except EOFError as e:
        break
Q:为什么我的程序在自己的电脑上正常编译,而系统告诉我编译错误!
A:GCC的编译标准与VC6或者Visual Studio有些不同,没有stdafx.h,同时更加符合c/c++标准:
main 函数必须返回int, void main 的函数声明会报编译错误。
i 在循环外失去定义 "for(int i=0...){...}"
itoa 不是ansi标准函数.
__int64 不是ANSI标准定义,只能在VC使用, 但是可以使用long long声明64位整数。
如果用了__int64,试试提交前加一句#define __int64 long long
Q:系统返回信息都是什么意思?
A:详见下述:
Pending : 系统忙,你的答案在排队等待.

Pending Rejudge: 因为数据更新或其他原因,系统将重新判你的答案.

Compiling : 正在编译.
Running & Judging: 正在运行和判断.
Accepted : 程序通过!

Presentation Error : 答案基本正确,但是格式不对。

Wrong Answer : 答案不对,仅仅通过样例数据的测试并不一定是正确答案,一定还有你没想到的地方.

Time Limit Exceeded : 运行超出时间限制,检查下是否有死循环,或者应该有更快的计算方法。

Memory Limit Exceeded : 超出内存限制,数据可能需要压缩,检查内存是否有泄露。

Output Limit Exceeded: 输出超过限制,你的输出比正确答案长了两倍.

Runtime Error : 运行时错误,非法的内存访问,数组越界,指针漂移,调用禁用的系统函数。请点击后获得详细输出。
Compile Error : 编译错误,请点击后获得编译器的详细输出。

Q:如何参加在线比赛?
A:注册 一个帐号,然后就可以练习,点击比赛列表Contests可以看到正在进行的比赛并参加。

SICNUOJ:

Frequently Asked Questions
Where is the input and the output?
Your program shall read input from stdin('Standard Input') and write output to stdout('Standard Output'). For example,you can use scanf in C or cin in C++ to read from stdin,and use printf in C or cout in C++ to write to stdout. User programs are not allowed to read or write files, or you will get a Runtime Error.

What's the meaning of the submission execution time?
The onlinejudge might test your code multiple times with different input files. If your code gives the correct answer within the time limit for each input file, the execution time displayed is the max of the time spent for each test case. Otherwise, the execution time will have no sense.

How can I use C++ Int64?
You should declare as long long and use with cin/cout or %lld, using __int64 will result in Compile Error.

Java specifications?
All programs must begin in a static main method in a Main class. Do not use public classes: even Main must be non public to avoid compile error.Use buffered I/O to avoid time limit exceeded due to excesive flushing.

About presentation error?
There is no presentation error in this oj.The judger will trim the blacks and wraps in your ouput's last line. if it's still different with the correct output, the result will be Wrong Answer.

How to report bugs about this oj?
The onlinejudge is open source, you can open an issue in Github. The details(like env, version..) about a bug is required, which will help us a lot to solve the bug. Certainly, we are very pleased to merge your pull requests.

SSZXOJ:

Q:这个在线裁判系统使用什么样的编译器和编译选项?
A:系统运行于Debian/Ubuntu Linux. 使用GNU GCC/G++ 作为C/C++编译器, Free Pascal 作为pascal 编译器 ,用 openjdk-7 编译 Java. 对应的编译选项如下:
C:	gcc Main.c -o Main -fno-asm -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE
C++:	g++ -fno-asm -Wall -lm --static -std=c++11 -DONLINE_JUDGE -o Main Main.cc
Pascal:	fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci
Java:	javac -J-Xms32m -J-Xmx256m Main.java 
*Java has 2 more seconds and 512M more memory when running and judging.
编译器版本为(系统可能升级编译器版本,这里直供参考):
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
glibc 2.3.6
Free Pascal Compiler version 2.4.0-2 [2010/03/06] for i386
java version "1.6.0_22"

Q:程序怎样取得输入、进行输出?
A:你的程序应该从标准输入 stdin('Standard Input')获取输入,并将结果输出到标准输出 stdout('Standard Output').例如,在C语言可以使用 'scanf' ,在C++可以使用'cin' 进行输入;在C使用 'printf' ,在C++使用'cout'进行输出.

用户程序不允许直接读写文件, 如果这样做可能会判为运行时错误 "Runtime Error"。

下面是 1000题的参考答案

C++:

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}
C:

#include <stdio.h>
int main(){
    int a,b;
    while(scanf("%d %d",&a, &b) != EOF)
        printf("%d\n",a+b);
	return 0;
}
PASCAL:

program p1001(Input,Output); 
var 
  a,b:Integer; 
begin 
   while not eof(Input) do 
     begin 
       Readln(a,b); 
       Writeln(a+b); 
     end; 
end.


Java:

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner cin = new Scanner(System.in);
		int a, b;
		while (cin.hasNext()){
			a = cin.nextInt(); b = cin.nextInt();
			System.out.println(a + b);
		}
	}
}
Q:为什么我的程序在自己的电脑上正常编译,而系统告诉我编译错误!
A:GCC的编译标准与VC6有些不同,更加符合c/c++标准:
main 函数必须返回int, void main 的函数声明会报编译错误。
i 在循环外失去定义 "for(int i=0...){...}"
itoa 不是ansi标准函数.
__int64 不是ANSI标准定义,只能在VC使用, 但是可以使用long long声明64位整数。
如果用了__int64,试试提交前加一句#define __int64 long long
Q:系统返回信息都是什么意思?
A:详见下述:
Pending : 系统忙,你的答案在排队等待.

Pending Rejudge: 因为数据更新或其他原因,系统将重新判你的答案.

Compiling : 正在编译.
Running & Judging: 正在运行和判断.
Accepted : 程序通过!

Presentation Error : 答案基本正确,但是格式不对。

Wrong Answer : 答案不对,仅仅通过样例数据的测试并不一定是正确答案,一定还有你没想到的地方.

Time Limit Exceeded : 运行超出时间限制,检查下是否有死循环,或者应该有更快的计算方法。

Memory Limit Exceeded : 超出内存限制,数据可能需要压缩,检查内存是否有泄露。

Output Limit Exceeded: 输出超过限制,你的输出比正确答案长了两倍.

Runtime Error : 运行时错误,非法的内存访问,数组越界,指针漂移,调用禁用的系统函数。请点击后获得详细输出。
Compile Error : 编译错误,请点击后获得编译器的详细输出。

Q:如何参加在线比赛?
A:注册 一个帐号,然后就可以练习,点击比赛列表Contests可以看到正在进行的比赛并参加。

(我尽力了)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值