# Neural Network Training Report: Official Solution

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

*Task 6 of the school stage (Moscow) of the All-Russian School Olympiad (VsOSh) 2025/26 in artificial intelligence, grades 9–11: official solution (the statement is in a separate file). Original: [sol-ai-9-11-sch-msk-25-26.pdf](https://vos.olimpiada.ru/upload/files/Arhive_tasks/2025-26/school/ai/sol-ai-9-11-sch-msk-25-26.pdf).*

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

**Maximum score for the task — 20**

**Solution.**

Let the timestamps (in minutes) be $t_1, \ldots, t_n$. The minimum interval between neighbouring timestamps is

$$
\Delta_i = \begin{cases} t_{i+1} - t_i, & t_{i+1} \ge t_i, \\ (24 \cdot 60 - t_i) + t_{i+1}, & t_{i+1} < t_i. \end{cases}
$$

We add up $\Delta_1 + \Delta_2 + \cdots + \Delta_{n-1}$. Training could have started almost immediately before the first timestamp, so the answer is 1 less.

```python
n = int(input())
prev = None
s = 0
day = 24 * 60
for _ in range(n):
    hh, mm = map(int, input().strip().split(':'))
    t = hh * 60 + mm
    if prev is None:
        prev = t
        continue
    if t >= prev:
        s += t - prev
    else:
        s += day - prev + t
    prev = t
print(s - 1)
```
