Solution in C/C++

All solutions, regardless of the programming language, are checked by an automatic system. The verification system creates an isolated, empty environment for your application, compiles it and executes multiple times with a different set of input. After that, the checking system compares the output data by the program with the expected result using a special algorithm.

The checking system does not analyze the program code, does not check its content, formatting, variable name, program size, etc.

In the case of checking using I/O files, the output to the standard I/O stream (stdin and stdout) is ignored. In the case of using standard I/O streams (stdin and stdout), the checking system does not analyze the files created by the solution.

The input always corresponds to the constraints specified in the problem condition. The solution does not need to check the correctness of the input if this is not stated in the condition of the problem. Be careful, the lines in the input data are separated by a symbol of transition to a new line \n or a combination of characters for moving to a new line and returning the cursor: \r\n . The program should correctly work out both options.

The answer is all output when it is executed, so if your program displays additional messages, such as “Enter a number” or “Answer:" these messages will be considered part of the response and the solution will not be counted. Follow the instructions in the problem condition to format the answer correctly.

You can send a solution implemented in the C or C++ programming language using the C++ compiler. The checking system uses the g++ compiler. The compiler runs with the following parameters:

g++ -std=c++11 -O2 -fno-strict-aliasing -DEOLIMP -DEOLYMP -DONLINE_JUDGE -lm -x c++ source.cpp -o a.out

In the case when the compiler returns an error, the solution is not tested and the checking system counts “Compile error”. The solution page displays an error message generated by the compiler.

Examples of solving a simple problem on C/C++

Example using the library

#include<stdio.h>

int main() {
    int a = 0;
    scanf("%d", &a);
    printf("%d %d\n", a/10, a%10);

    return 0;
}

Example using the library

#include <iostream>
using namespace std;

int main(){
    int a;
    cin>>a;
    cout<< a/10 <<" "<< a%10 << endl;

    return 0;
}

Example using input and output files

#include <bits/stdc++.h>
using namespace std;

int main(){
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);

    int a;
    cin>>a;
    cout<< a/10 <<" "<< a%10 << endl;

    return 0;
}