How to solve a problem

How to solve a problem

In order to solve a problem on this site you need to write a program in one of the programming languages ​​that implements the required algorithm.

The program must read the input data from the standard input stream (console) and output the result to the standard output stream (console). Different programming languages ​​have different methods for reading and writing data to standard input and output streams.

For example, in the C ++ programming language, you can use the iostream library:

int a;
cin>>a; // count the number in the variable a
cout<<a; // print the value of the variable a in the standard output stream

In Python you can use input and print functions:

a = int(input())

You can see more examples in other programming languages ​​in the Help section.

The problem statement always specifies what data and in what format will be available for reading, as well as what data and in what format should be printed. The input data always meets the constraints specified in the statement, so there is no need to check the correctness of the input, unless otherwise stated in the statement.

The answer is consider to be all the data printed by the program during its execution, so if your program prints additional messages, such as "Enter number" or "Answer:", these messages will be considered part of the answer and the tests won't be accepted. Follow the instructions in the statement to format the answer correctly. Your program must output data identical to the example given under the statement of the problem, otherwise the answer won't be accepted.

You can find examples of Simple problem solutions in different programming languages ​​in the help section.

You can write the solution in the editor of the contest system, or in your own editor. Click the "Editor" tab above the problem statement and select a programming language. Use the "Run" button to run the program with your own input.

Screenshot 2020-12-14 at 00.03.58.png

And when you are ready to send your solution, click on the "Submit" button.

After submitting you will see the results in the table below, each row corresponds to one test. You will be able to see the test number, result, execution time and the amount of memory used.

Screenshot 2020-12-14 at 00.03.22.png

Important! Currently, the editor is available only in the contest system. To submit a solution on the site, use the submission form.