Important information

Algochecker is a system which performs automatic testing of programs submitted by users. In order to get along with it, you need to comply with these rules:

More details are listed below.

Code submissions

Usually, you are requested to upload only the source code of your program. Depending on the programming language, the source files have the following extensions:

language extensions
C .c, .h
C++ .cpp, .hpp
Python .py
Java .java

Unless asked explicitly, please do not upload any binaries and project files like .exe, .obj or .cbp.

Also, your source code should contain everything, which is required for a program in order to be compilable. This means that all required headers (imports) have to be included, all definitions of custom functions must be provided etc.

Program output requirements

Similarly to the real world programming, each task has a very strictly defined "protocol". What does it mean in simple words?

If you are asked to write a program in C language which reads two numbers and then prints a single number being the sum of these numbers, then you should do it like this:

#include <stdio.h>

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

    return 0;
}

Such solution is fully correct, but remember that your program is not allowed to print any additional text unless it is stated explicitly in the task description.

Do not write like this:

printf("The sum of numbers is: %d", a+b);

Also do not write like this:

printf("Please enter the first number: ");

// ... some code which reads the number ...

Such program would be immediately marked as totally incorrect, because the task was to output just a number, nothing else. Similarly, if the task is to output YES and you would output yes or Yes instead then the answer is also considered improper.

Your program is going to be automatically tested by a machine (and machines are "stupid"), so every mistake is treated as an error. For that reason, usually you have multiple possibilities to improve your code and send it again.

Requirements stated above may sound silly, but during your potential work as a programmer, from time to time you may be asked to write a program in a very strict manner according to a specification. For instance, a program which produces an image (let's say a .bmp file) must do it perfectly according to the file format requirements. Any small mistake would cause the image not to be displayed, but you would see a "corrupted file" error instead. Because of this, being precise is a very important skill which will allow you to make a lot of money :)

If you feel that the program is correct, but the Algochecker is still giving you 0% and you are starting to get mad, please use the Feedback form (the link is also available at the bottom of each page). In the form, state which task you are fighting with, what your name is and shortly describe the problem.

Test result interpretation

After your program has been evaluated by the Algochecker, you are able to see the report created by the checking machine.

The "Tests" table present in the report describes results of tests performed against your programs. If there are 4 rows in the table, then it means that your program was tested using 4 different data sets.

The screenshot presents the following situation:

Test grouping

Sometimes tests can be grouped. Naming convention for that is {group_name}-{test_name}. Grouping means that the group of tests is marked as it was a single test. For example, passing one test in a group consisting of two tests means that the whole group is failed.

Reasoning: this is done in order to prevent programs which output, say, static answer to a question which requires "yes" or "no" to get some reasonable score.

Example: consider the task which requires to output "yes" if an integer is divisible by 10 and "no" otherwise. For this task there are defined 4 tests. Two of them require answer "yes" and two — "no". So the program which outputs "yes" will get 50% of the score even though it does basically nothing.

Input data

There is no possibility to see what data caused the program to malfunction. The only option is to read the task once again and then read your code very carefully in order to find mistakes.

Testing is always performed using valid sets of data. This means - using input data which satisfy all requirements described in the instruction for the task. If your program was not evaluated to 100% then you have to find some valid data set which causes program to work improperly.