In each problem, you should write code that reads input and prints output.
When you submit your code, the training site will automatically run it on several secret test cases.
For each test case, your code's output is compared to the correct output, and you will receive one of the following verdicts:
Correct. You correctly solved this case. Great job!
Wrong Answer. Your code produced the wrong answer. If this is a sample case, you can click to see your code's output. All other cases are secret.
Partially Correct. In most problems, your answer can either be correct or wrong. However, in some problems, you can receive partial marks for a test case. If partial marks are available then this will be mentioned in the problem.
Time Limit Exceeded. Each problem has a time limit that specifies the maximum amount of time that your code can use in each test case. This verdict means that your code ran for too long. Often this means that you need to design a more efficient algorithm to solve the problem. Learning about Time Complexity will be helpful for this.
Memory Limit Exceeded. Each problem has a memory limit that specifies the maximum amount of memory that your code can use in each test case. This verdict means that your code used too much memory.
Runtime Error. An error occurred with your code while it was running. There are many possible causes for this, including accessing invalid array indices, division by 0, or accessing an undefined variable in Python.
Skipped. If your code has received the Time Limit Exceeded verdict on 3 cases in a subtask then the remaining cases will be skipped.
Subtasks
Test cases are grouped into subtasks, and each subtask has a specified number of points that all add up to 100.
You must correctly solve every test case in a subtask to score the points for that subtask.
This means that failing just a single test case will cause you to earn 0 points for a subtask.
If you receive the "Partially Correct" verdict, your score for a subtask is the minimum score earned for a test case in that subtask.
When you make multiple submissions, your score for a subtask is your maximum score for this subtask across all of your submissions. Your score for a problem is the sum of your scores in each subtask.
Supported Programming Languages
You may submit code in the following languages:
C++11
C++20
Python 3 (CPython, 3.10.12)
Python 3 (PyPy, 3.9.19)
Java 18. Java solutions should be in a class called Solution and must be run from the routine public static void main(String[] args) within this Solution class.