UVa Submission specification

Currently, only the submissions via the "Quick Submit" link or the "Submit" icon for each problem is possible. In order to submit your code, just fill in the form and press "submit". Using this form, you don't have to include any special header to the file as everything is handled by the system.

General Specifications:

The program reads the test input from the standard input (stdin) and places the results in the standard output (stdout). This is always the case, regardless on what the problem description says.

The program doesn't need (in fact, they aren't allowed to) open files or to execute some system calls. Remember: never try to open any file or your program will be judged as wrong.

In order to help some people, the Online Judge defines always the 'ONLINE_JUDGE' symbol while compiling your program. Thus, you can test for it to redirect the input/output to a file except while the Online Judge is testing your program by, for example, using the preprocessor directive #ifdef in C.

Pascal Specifications:

FreePascal compiler seems not to use signals to notify runtime errors, but emits a short text message which merges with your program outputs. So, if you have a Runtime Error, you might receive a Wrong Answer error instead. We know this is a problem, but we cannot focus on it right now.

C/C++ Specifications:

Don't assume that any header file (stdio.h, stdlib.h, math.h, etc) is going to be included by default. Please, include all the headers that you actually need.

The use of dangerous or deprecated functions is discouraged. We don't judge as Compile Error a submission using those functions, but you use them under your own risk. For example, the gets function can cause a runtime error even if fairly used. Please, use fgets instead.

Java Specifications:

The Java programs submitted must be in a single source code (not .class) file. Nevertheless, you can add as many classes as you need in this file. All the classes in this file must not be within any package.

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.

This information adopt from UVa Online Judge