# Analysis of the School-Stage Tasks of the All-Russian School Olympiad 2025/26 in Artificial Intelligence (Region Group III), Grades 9–11

*English translation by SOTA – AI Community of the Russian original. Organisers who would like this translation removed can email sota.ai.community@gmail.com.*

*Translator's note: the original is a single PDF in which each task's statement is followed by its answer, scoring criterion and solution. Tasks 7 and 8 are programming tasks: the file gives only their scoring criteria and solutions, not their statements. The data file for Task 6 and the candidate vectors for Task 4 are not part of the file. Spreadsheet formulas are given with English function names (see Task 6).*

**Maximum score for the olympiad — 112**

## Task 1

In collaborative learning (it is also called federated learning), many devices learn together: each one computes locally and sends only a small share of the total volume of numerical data. For this exchange, two-way communication channels have been laid between some pairs of devices. The task is performed by 10 devices. Two-way channels have been laid between some pairs of devices, 10 channels in total (there is never more than one channel between the same pair of devices). We call a group of devices an independent group if any device in it can be reached from any other via a chain of channels, and there is not a single channel between different such groups. What is the largest number of independent groups that can be obtained under these conditions?

**Answer:** 6

**Scoring criterion:** exact match of the answer — 12 points

**Maximum score for the task — 12**

**Solution.**

To create **as many** groups **as possible**, it pays to put *all* 10 channels *inside one* group and to leave the remaining devices one by one, separately. Then the channels will not “glue together” different groups.

How many devices are needed inside one group so that all 10 channels fit there? Inside a group of $t$ devices, the maximum number of channels is one between each pair, that is,

$$\text{maximum number of channels} = \frac{t \cdot (t - 1)}{2}.$$

$$t = 5: \ \frac{5 \cdot 4}{2} = 10.$$

Hence, we can make one large group of 5 devices and put all 10 channels there. The remaining $10 - 5 = 5$ devices stand one by one — that is 5 more groups.

Total number of groups: 1 large + 5 singletons = 6.

Why can there not be more than 6? If we try to make the large group out of fewer than 5 devices, at most 6 channels fit inside it; the remaining channels will inevitably start connecting different groups with each other, and the number of groups will decrease. Therefore, the maximum is $\boxed{6}$.

## Task 2

Customers of the flower delivery service “Monobouquet” order bouquets of roses with probability $\frac{2}{3}$ and bouquets of daisies with probability $\frac{1}{3}$. Yesterday the intern Petya carefully looked through the orders and sent out six bouquets: roses, roses, daisies, roses, roses, roses. After that, he decided not to waste time reading the descriptions, but to make all bouquets from roses only and send them straight to the customer's address. Today orders arrive one after another until a request for daisies appears; after that Petya will be fired, because the customer will receive the wrong bouquet! Find the mathematical expectation of the number of bouquets that Petya will manage to make correctly today.

**Answer:** 2

**Scoring criterion:** 6 points for each correct answer. Total — 12 points

**Maximum score for the task — 12**

**Solution.**

Denote by $E$ the mathematical expectation of the number of bouquets assembled correctly today.

The first order today is for roses with probability $q = \frac{2}{3}$ and for daisies with probability $p = \frac{1}{3}$. By the law of total probability for the expectation, we obtain the recurrence equation:

$$E = q \cdot (1 + E) \ + \ p \cdot 0.$$

Indeed, if roses were ordered (with probability $q$), Petya assembled one bouquet correctly and the process starts “from scratch” ($E$ more are still expected); if daisies were ordered (with probability $p$), he is fired at once and there will be no more correct bouquets.

We solve:

$$E = q + qE \implies E(1 - q) = q \implies E = \frac{q}{1 - q} = \frac{\frac{2}{3}}{\frac{1}{3}} = 2.$$

## Task 3

Points are given on the coordinate plane; each of them belongs to one of four classes numbered 0, 1, 2 or 3. The class of a new point is to be predicted by the $k$ nearest neighbours rule:

- for the chosen number $k$, take the $k$ training points closest to the point $q$;
- among the chosen $k$ points, count which class number occurs most often, and output that number;
- if several classes occurred equally often, choose the one among them for which the sum of the distances from $q$ to all points of this class (among the chosen $k$) is smaller, and if these sums are also equal, the class with the smaller number.

The training points are given:<br>
Class 0: red.<br>
Class 1: blue.<br>
Class 2: green.<br>
Class 3: yellow.<br>
Denote the total number of training points by $N$ (here $N$=18). Consider all integer points $q$ inside the smallest rectangle with sides parallel to the coordinate axes that contains all the given points. For each such point $q$, we write out the predictions of the $k$ nearest neighbours rule for $k = 1, 2, ..., N$.

*[Figure: see the [original statement](https://siriusolymp.ru/2025/ai).]*

*Translator's transcription of the figure (a scatter plot with $x$ from 0 to 10 and $y$ from −2 to 5):*

| Class | Marker in the figure | Points |
|---|---|---|
| 0 | red circle | $(8, 2)$, $(8, 3)$, $(9, 2)$ |
| 1 | blue square | $(2, 3)$, $(3, 4)$, $(4, 3)$, $(5, 3)$ |
| 2 | green triangle | $(5, 0)$, $(6, 0)$, $(7, 0)$, $(7, -1)$, $(8, -1)$ |
| 3 | orange diamond | $(1, 2)$, $(4, 2)$, $(2, 1)$, $(4, 1)$, $(6, 1)$, $(2, 0)$ |

Determine the coordinates of the unique integer point $q$ inside this rectangle for which, as $k$ runs through $1, 2, ..., 18$, the predictions contain each of the four classes 0, 1, 2, 3 at least once.

**Answer:** $q = (7, 4)$

**Scoring criterion:** exact match of the answer — 12 points

**Maximum score for the task — 12**

**Solution.**

One can notice that if a point is far from the red or the blue cluster, it cannot be assigned the corresponding class for any $k$. For example, if the point is at the bottom left, then 4 orange points will be collected among the nearest neighbours first, and the 3 red ones will no longer be able to affect the answer. The same applies to the four blue points.

Hence, it makes sense to look only at the points between the red and the blue clusters. Let us prove that the point $(7, 4)$ fits.

Let us sort the neighbours of $q = (7, 4)$ (in ascending order of $r^2$; in case of equality, the smaller class number comes first):

| $k$ | point | class | $r^2$ |
|---:|:---:|:---:|---:|
| 1 | $(8, 3)$ | 0 | 2 |
| 2 | $(8, 2)$ | 0 | 5 |
| 3 | $(5, 3)$ | 1 | 5 |
| 4 | $(9, 2)$ | 0 | 8 |
| 5 | $(4, 3)$ | 1 | 10 |
| 6 | $(6, 1)$ | 3 | 10 |
| 7 | $(4, 2)$ | 3 | 13 |
| 8 | $(3, 4)$ | 1 | 16 |
| 9 | $(7, 0)$ | 2 | 16 |
| 10 | $(6, 0)$ | 2 | 17 |
| 11 | $(4, 1)$ | 3 | 18 |
| 12 | $(5, 0)$ | 2 | 20 |
| 13 | $(7, -1)$ | 2 | 25 |
| 14 | $(2, 3)$ | 1 | 26 |
| 15 | $(8, -1)$ | 2 | 26 |
| 16 | $(2, 1)$ | 3 | 34 |
| 17 | $(1, 2)$ | 3 | 40 |
| 18 | $(2, 0)$ | 3 | 41 |

**The model's answer as $k$ increases:**

| $k$ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class (answer) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 2 | 3 |

*Explanation of the ties.* For $k = 8$, classes 0 and 1 have three points each, but the sum of distances is smaller for class 0 — we take 0. For $k = 14$ there is a 1–2 tie; 1 wins by the smaller sum of distances. For $k = 17$ there is a 2–3 tie; 2 wins by the smaller sum of distances.

So, as $k$ runs through $1, 2, \ldots, 18$, all four classes $0, 1, 2, 3$ occur among the answers, which is what we need. (Checking the remaining integer points inside the rectangle shows that the only suitable point is $q = (7, 4)$.)

This task could also be solved by programming.

```python
from collections import Counter, defaultdict

P = {
    0: [(8, 2), (8, 3), (9, 2)],
    1: [(3, 4), (4, 3), (5, 3), (2, 3)],
    2: [(7, 0), (8, -1), (7, -1), (6, 0), (5, 0)],
    3: [(1, 2), (6, 1), (4, 2), (2, 0), (2, 1), (4, 1)],
}
S = [(x, y, c) for c in P for x, y in P[c]]
xs, ys = zip(*[(x, y) for x, y, _ in S])

def seq(X, Y):
    d = sorted(
        ((x - X) ** 2 + (y - Y) ** 2, c) for x, y, c in S
    )
    cnt = Counter()
    s = defaultdict(float)
    out = []
    for r2, c in d:
        cnt[c] += 1
        s[c] += r2**0.5
        m = max(cnt.values())
        C = [t for t in cnt if cnt[t] == m]
        out.append(
            min(C, key=lambda t: (s[t], t))
        )
    return out

ans = [
    (X, Y)
    for X in range(min(xs), max(xs) + 1)
    for Y in range(min(ys), max(ys) + 1)
    if len(set(seq(X, Y))) == 4
]
print(ans)
```

## Task 4

To compare the meanings of words, a computer assigns each word three numbers $(x, y, z)$ — a meaning vector. To measure how close two words are, one takes the number

$$S = x_1 x_2 + y_1 y_2 + z_1 z_2,$$

that is, the corresponding coordinates are multiplied and added up. Then:

- if $S > 0$, the words are close in meaning;
- if $S < 0$, the meanings are opposite;
- if $S = 0$, there is no connection in meaning.

Six words with known meaning vectors are given:

| Word | Meaning vector |
|:---:|:---:|
| camel | $(3,\ 4,\ 5)$ |
| fish | $(-3,\ -4,\ 0)$ |
| snowman | $(-4,\ 3,\ -5)$ |
| tea | $(-7,\ 1,\ 5)$ |
| glacier | $(3,\ 4,\ -5)$ |
| pond | $(-7,\ 1,\ 0)$ |

Determine the meaning vectors for the words iceberg, whale, mouse and kettle.

*[Translator's note: the original file does not list the vectors to choose from. The official solution calls them A, B, C and D; as a set, they are $(-4, 3, 0)$, $(-4, 3, 5)$, $(4, -3, 0)$ and $(4, -3, -5)$.]*

**Answer:**

- Kettle – $(-4, 3, 5)$
- Iceberg – $(4, -3, -5)$
- Whale – $(-4, 3, 0)$
- Mouse – $(4, -3, 0)$

**Scoring criterion:** 3 points for each correct answer. Total — 12 points

**Maximum score for the task — 12**

**Solution.**

**1) Kettle.** We want a strong connection with “tea” and a zero connection with “snowman”.

$$\langle A, \text{tea} \rangle = (-4) \cdot (-7) + 3 \cdot 1 + 5 \cdot 5 = 56 > 0, \qquad \langle A, \text{snowman} \rangle = 16 + 9 - 25 = 0.$$

$A$ fits. Hence, *kettle* $\to (-4, 3, 5)$.

**2) Iceberg.** It should be “cold”: close to “glacier” and opposite to “camel”.

$$\langle B, \text{glacier} \rangle = 4 \cdot 3 + (-3) \cdot 4 + (-5) \cdot (-5) = 25 > 0, \quad \langle B, \text{camel} \rangle = 4 \cdot 3 + (-3) \cdot 4 + (-5) \cdot 5 = -25 < 0.$$

$B$ fits. Hence, *iceberg* $\to (4, -3, -5)$.

**3) Whale.** A connection with water without “up/down” along $z$: close to “pond” and orthogonal to “fish”.

$$\langle C, \text{pond} \rangle = (-4) \cdot (-7) + 3 \cdot 1 + 0 \cdot 0 = 31 > 0, \qquad \langle C, \text{fish} \rangle = 12 - 12 + 0 = 0.$$

$C$ fits. Hence, *whale* $\to (-4, 3, 0)$.

**4) Mouse.** The last vector $D = (4, -3, 0)$ remains. As a check: $\langle D, \text{fish} \rangle = -12 + 12 + 0 = 0$, $\langle D, \text{camel} \rangle = 12 - 12 + 0 = 0$; neutral connections are acceptable.

**Answer.**

$$
\begin{array}{lcl}
\text{kettle} & \to & (-4,\ 3,\ 5),\\
\text{iceberg} & \to & (4,\ -3,\ -5),\\
\text{whale} & \to & (-4,\ 3,\ 0),\\
\text{mouse} & \to & (4,\ -3,\ 0).
\end{array}
$$

## Task 5

In a binary classification problem (dividing objects into 2 classes), a total of $N$=1000 objects are given, of which $P$=400 are positive and $N - P = 600$ are negative. Let:

- $TP$ — correctly predicted positive objects (True Positives);
- $FP$ — negative objects mistakenly predicted as positive (False Positives);
- $FN$ — positive objects mistakenly predicted as negative (False Negatives);
- $TN$ — correctly predicted negative objects (True Negatives).

Metrics:

$$\text{Precision (precision for the positive class)} = \frac{TP}{TP + FP},$$

$$\text{Accuracy (the share of correct answers)} = \frac{TP + TN}{N},$$

It is known that Accuracy $= 0.8$. Find the range of possible values of Precision.

**Answer:** $\left[\dfrac{2}{3}, 1\right]$

**Scoring criterion:** 6 points each for the lower and the upper bound. Total — 12 points

**Maximum score for the task — 12**

**Solution.**

From $\text{Accuracy} = \dfrac{TP + TN}{1000} = 0.8$ we obtain

$$TP + TN = 800 \quad \Longrightarrow \quad FP + FN = 200.$$

Since $FN = P - TP = 400 - TP$, we have

$$FP = 200 - (400 - TP) = TP - 200.$$

Then

$$\text{Precision} = \frac{TP}{TP + FP} = \frac{TP}{TP + (TP - 200)} = \frac{TP}{2TP - 200}.$$

Constraints on the meaningful values:

$$FN \ge 0 \Rightarrow TP \le 400, \qquad FP \ge 0 \Rightarrow TP \ge 200,$$

that is, $TP \in [200, 400]$. The function

$$f(TP) = \frac{TP}{2TP - 200} = \frac{1}{2 - \frac{200}{TP}}$$

decreases on this segment, therefore

$$TP = 200 \ \Rightarrow\ \text{Precision} = 1, \qquad TP = 400 \ \Rightarrow\ \text{Precision} = \frac{400}{600} = \frac{2}{3}.$$

Thus, $\text{Precision} \in \left[\dfrac{2}{3}, 1\right]$.

## Task 6

The data for this task are in a spreadsheet file. You can download the file in one of three formats: XLSX, ODS, CSV.

A rectangular table is given; each of its rows contains five natural numbers. Denote the value in the third column by $x$. Let us find the mean value of this column:

$$\bar{x} = \text{the arithmetic mean of all } x.$$

We will consider a row's value an *outlier* if the following inequality holds:

$$|x - \bar{x}| > \bar{x}.$$

**Problem.** In how many rows is the value in the third column an outlier?

**Answer:** 11

**Scoring criterion:** exact match of the numerical answer — 12 points

**Maximum score for the task — 12**

**Solution.**

*Translator's note: the original writes the formulas below for a Russian-language spreadsheet (Russian function names and semicolons between arguments); here they are given with the English function names AVERAGE, IF and SUM.*

**Step 1. The mean of the third column.** In any free cell (for example, G2):

`=AVERAGE(C2:C101)`

This is $\bar{x}$.

**Step 2. Checking the outlier condition for each row.** In cell F2 enter (we fix the row with the mean using `$`):

`=IF(ABS(C2-G$2)>G$2, 1, 0)`

Drag the formula down to F101.

**Step 3. Counting the outliers.** In any free cell, for example H2:

`=SUM(F2:F101)`

The resulting number is the number of rows in which the value $x$ in the third column is an outlier.

## Task 7

*[The statement of this programming task is not included in the original file.]*

**Scoring criterion:** 1 point for each test not taken from the statement. Total — 20 points

**Maximum score for the task — 20**

**Solution.**

Adjacent layers are fully connected: between layer $i$ and layer $i+1$ there are $a_i \cdot a_{i+1}$ connections. In total:

$$a_1 a_2 + a_2 a_3 + \cdots + a_{n-1} a_n.$$

```python
n = int(input())
a = [int(input()) for _ in range(n)]
s = 0
for i in range(n - 1):
    s += a[i] * a[i + 1]
print(s)
```

## Task 8

*[The statement of this programming task is not included in the original file.]*

**Scoring criterion:** 1 point for each test not taken from the statement. Total — 20 points

**Maximum score for the task — 20**

**Solution.**

We scan the string from left to right, looking for the substrings `":)"` and `":("`. When a smiley is found, we increase the corresponding counter and move the position on by 2 so that smileys do not overlap; otherwise we move on by 1. Then we compare the counts: more smiles — `HAPPY`, more sad faces — `SAD`, equal and zero — `NEUTRAL`, equal and greater than zero — `MIXED`.

```python
s = input()
happy = 0
sad = 0
i = 0
while i + 1 < len(s):
    if s[i] == ':' and (s[i+1] == ')' or s[i+1] == '('):
        if s[i+1] == ')':
            happy += 1
        else:
            sad += 1
        i += 2
    else:
        i += 1

if happy > sad:
    print("HAPPY")
elif sad > happy:
    print("SAD")
elif happy == 0:
    print("NEUTRAL")
else:
    print("MIXED")
```
