Problem name
Follow common title capitalization rules when writing English problem names. Example: «The Best of the Problems» instead of «The best of the problems». This is not applicable to Ukrainian statements.
Avoid using any special characters in problem names (&\(^\wedge\)@* or similar).
Must not be too long (7 words or fewer).
Problem name must be unique in both English and Ukrainian (there should be no problem with the same name in the archive).
Limits
Default time limit: 2 s.
Default memory limit: 256 MB.
Time limit up to 7 s.
Memory limit up to 1024 MB, at least 128 MB, and must be a power of 2.
If time or memory limit is less than the default, make sure it’s well solvable in Java and Python.
Paragraphs
Separate paragraphs with an empty line in LaTeX; don’t use paragraph indentation or
\par
command.The statement must not be a single large paragraph. Split the statement into multiple logical paragraphs for readability purposes.
Variables
By default, all statement and input variables must be enclosed in
$
, for example:$n$
.Variables must not be bold.
It’s recommended to keep variable names single-letter and lower-case.
Use common variable names when available (e. g. \(n\) for the number of vertices, \(m\) for the number of edges, \(k\) or \(q\) for the number of requests).
Avoid indexing variable names (e. g. \(i\) or \(j\)) as input variables.
Literals
Literal numbers must not be enclosed in
$
. Example: Vertices are numbered from 1 to $n$, inclusive. Exception: if the statement requires outputting -1 when the answer does not exist, treat -1 as a literal string (see below).Literal strings must be enclosed in
\texttt{}
. For example, use\texttt{YES}
when describing positive output string.Do not use quotes for literal strings.
Numbering literals (or variables) must have a proper ending, e. g. the 2-nd, the $i$-th, etc. The same holds for the Ukrainian language
Array literals must not be enclosed in
$
, for example, [4, 7].
Formulas
All mathematical formulas must be enclosed in
$
, for example:$n < m$
.Don’t use * for multiplication. Use
\cdot
instead (e. g.$n \cdot m$
).Use
\times
for matrix dimension description, e. g. matrix of size$n \times m$
.Don’t use division sign /. Use fraction instead:
$ \frac{a}{b}$
.Use proper LaTeX commands as inequality signs:
\le
for ’less than or equal’,\ge
for ’greater than or equal’.Large formulas must be placed on a separate line and centered by enclosing in
$$
(double dollar-sign), for example:$$n < m$$
.Use
^
and_
for sup and sub, for example:$10^9$, $2^{nk}$, $a_i$
.Always use appropriate LaTeX commands when describing math symbols. Refer to this page for the full list of possible math commands.
Arrays (except literals) should be written as the following:
$[a_1, a_2, \ldots, a_n]$
.
Input
Always specify if the input token is an integer, float, string, or single character.
If the input contains floats, it must be clearly stated what format is expected.
Use the following style when describing input in English:
The first line of the input contains a pair of integers ..., The following $m$ lines describe..., etc
. Always use proper English articles.Do not leave input over-simplified, e. g. avoid
One integer $n$
. Instead, write:The first line of input contains one integer $n$ – number of bottles
.Each variable in the input must be briefly described.
Output
If it’s possible to have no answer, it should be clearly stated in the output section.
If there are multiple possible answers, it should be stated in the output section.
If it’s guaranteed that for the given input there’s always an answer, this should be stated in the output section.
If the answer contains float numbers, the output section must specify the allowed precision (absolute and/or relative).
If the answer has to be output modulo some number, it should be stated in the output section. It should be explicitly stated if the modulo number is prime.
Use the following style when describing output in English:
Print a single integer denoting the minimum number ...
etc. Always use proper English articles.Do not leave output over-simplified, e. g. avoid
Answer to the problem.
Instead, write:In one line print single integer n – number of bottles
.
Constraints
All constraints must be placed in the dedicated section of the statement. It’s allowed to copy constraints in the main statement section for emphasis purposes.
Combine constraints when appropriate:
$1 \le n, m \le 1000$
.Each constraint inequality must be placed in a separate line of the statement (hence separated by an empty line in LaTeX).
Length of a string must be denoted as |s|.
Use proper inequality signs (as described in the Formulas section).
Always try to make constraint numbers as readable as possible. For example, write
$1 \le n \le 2 \cdot 10^9$
instead of$1 \le n \le 2000000000$
.Use round or lucky numbers as constraints.
Each constraint line should end with a comma, the last one - with a dot. Any statement (except the first one) should start in a lower-case.
Lists
Use proper LaTeX commands for lists:
Unordered (bulletpoint) list: \begin{itemize} \item One entry in the list \item Another entry in the list \end{itemize} Ordered (numerated) list: \begin{enumerate} \item One entry in the list \item Another entry in the list \end{enumerate}
Images
All images must be uploaded in the Resources section of an Algotester problem.
Images are referenced by resource name without file extension.
Images must be centered by default, with the image description below:
\begin{center} \includegraphics[width=0.5\textwidth]{resource-name} \end{center}
Samples
A statement must contain at least one sample.
Avoid too trivial samples (aka Boiko samples).
The first sample must be the first test case of the problem. The same holds for the following samples, if any.
There is an opportunity to create samples only for statement.
Notes
The Notes section must contain sample descriptions when appropriate.
The Notes section can also contain additional definitions when needed, but they must also be referenced in the main statement.
Miscellaneous
Parts of the statement that need special emphasis (non-obvious constraints or conditions, corrected parts of the statements, etc.) must be bold (enclosed in
\textbf{}
).Use
---
in Ukrainian and--
in English, never use - as a long dash.Use spell-checker when writing English and Ukrainian statements.