Полигон YMLSYMLS PolygonТашкент · 2026Tashkent · 2026
до попыткиuntil the attempt —
МокиMocks

Учебные пробникиPractice mocks

RU

Состав и учебное время указаны у каждого пробника. Формат ответа задан в условии. Подсказки и решения доступны после завершения. Сохранённые описания старых пробников и протокол ниже — материалы курса, а не подтверждение официальных правил. Образец Q1–Q18 не устанавливает время, разрешённые инструменты или проходной балл экзамена.

EN

Each mock lists its questions and practice time. Follow the answer format in each statement. Hints and solutions become available after you finish. The retained older mock descriptions and protocol below are course materials, not confirmation of official rules. The Q1–Q18 sample establishes no official exam timing, permitted tools, or passing score.

день 1 · 50 минут

Диагностический срезDiagnostic snapshot

Шесть разминочных задач из шести разных блоков: счёт, случайные величины, производная, интеграл, векторы и матрицы, алгоритмы. Ни одна не раскрывает приём своего дня — каждая ждёт тебя там же, в разминке. Это не оценка и не отбор, а отправная точка: видно, где счёт идёт быстро, где медленно, а где пока никак. Пустое поле здесь такой же результат, как верный ответ.Six warm-up problems from six different blocks: counting, random variables, derivatives, integrals, vectors and matrices, and algorithms. None gives away the technique for its day—each one is waiting for you in that day’s warm-up. This is neither an assessment nor a selection round, but a starting point: it shows where your counting is fast, where it is slow, and where it is not working yet. Leaving the field blank here is just as informative as a correct answer.

день 7 · 150 минут

Мок № 1Mock 1

Восемь задач, 2 часа 30 минут. Время сжато намеренно: дефицит нужно пережить сейчас, а не 4 сентября.Eight problems, 2 hours 30 minutes. The time is intentionally compressed: experience the shortage now, not on September 4.

5/8
верных ответов
35
минут потрачено
Смотреть разбор
день 13 · 240 минут

Мок № 2 — полный боевойMock 2 — full exam simulation

Восемь задач, четыре часа. Ровно тот регламент, который будет послезавтра. Единственная разница — завтра попытка настоящая и одна.Eight problems, four hours. This is exactly the schedule you will face the day after tomorrow. The only difference is that the real attempt is tomorrow, and there is only one.

4/8
верных ответов
50
минут потрачено
Смотреть разбор
день 19 · 180 минут

Пробник 3: 18 типов задачMock 3: 18 problem types

18 новых задач по составу образца Q1–Q18, включая доказательства на бумаге. 180 минут и калькулятор — учебные настройки, не официальный регламент. Каждая задача самодостаточна; отвечай в её формате. После завершения проверь не только числа, но и обоснования. Официального проходного балла этот пробник не устанавливает.18 new questions following the Q1–Q18 topic mix, including written proofs. The 180-minute timer and calculator use are practice choices, not official rules. Each question is self-contained; follow its answer format. After finishing, check both numbers and reasoning. This mock establishes no official passing score.

8/18
верных ответов
92
минут потрачено
Смотреть разбор
день 19 · 180 минут

Пробник 4: 18 типов задачMock 4: 18 problem types

18 новых задач по составу образца Q1–Q18, включая доказательства на бумаге. 180 минут и калькулятор — учебные настройки, не официальный регламент. Каждая задача самодостаточна; отвечай в её формате. После завершения проверь не только числа, но и обоснования. Официального проходного балла этот пробник не устанавливает.18 new questions following the Q1–Q18 topic mix, including written proofs. The 180-minute timer and calculator use are practice choices, not official rules. Each question is self-contained; follow its answer format. After finishing, check both numbers and reasoning. This mock establishes no official passing score.

Разбор · Мок № 2 — полный боевойMock 2 — full exam simulation

Задача 1Уровень YMLSВероятностьМок № 2, задача 1
RU

В первой урне 5 белых и 3 чёрных шара, во второй — 2 белых и 6 чёрных. Из первой урны наугад вынимают два шара и, не глядя на них, перекладывают во вторую. После этого из второй урны наугад достают один шар, и он оказывается белым.

Найдите вероятность того, что оба переложенных шара были белыми.

Шары различаются только цветом: любая пара шаров при перекладывании равновозможна, и каждый из десяти шаров второй урны равновозможен при извлечении. Ответ округлите до четырёх знаков после запятой.

EN

The first urn contains 5 white balls and 3 black balls; the second contains 2 white balls and 6 black balls. Two balls are drawn uniformly at random from the first urn and transferred to the second without observing their colors. A ball is then drawn uniformly at random from the second urn, and it is white.

Find the probability that both transferred balls were white.

The balls differ only in color: every pair of balls is equally likely to be transferred, and each of the ten balls in the second urn is equally likely to be drawn. Round your answer to four decimal places.

правильный ответ 0.4396
Подсказка / Hint
RU

Гипотезы — сколько белых уехало во вторую урну; их три. Априорные вероятности берутся счётом пар в первой урне, знаменатель собирается формулой полной вероятности, и только потом условие разворачивается.

EN

Use three hypotheses, according to the number of white balls transferred to the second urn. Obtain their prior probabilities by counting pairs in the first urn, compute the denominator using the law of total probability, and only then reverse the conditioning.

Решение / Solution
RU

Гипотезы. $H_2$ — переложены два белых, $H_1$ — один белый и один чёрный, $H_0$ — два чёрных. Других вариантов нет, и они несовместны.

Априорные вероятности — счёт пар в первой урне. Всего пар $\binom{8}{2} = 28$:

$$\P(H_2) = \frac{\binom52}{28} = \frac{10}{28}, \qquad \P(H_1) = \frac{5 \cdot 3}{28} = \frac{15}{28}, \qquad \P(H_0) = \frac{\binom32}{28} = \frac{3}{28}$$

Правдоподобия. После перекладывания во второй урне 10 шаров, и белых в ней ровно столько, сколько было своих (2), плюс сколько приехало:

$$\P(W \mid H_2) = \frac{4}{10}, \qquad \P(W \mid H_1) = \frac{3}{10}, \qquad \P(W \mid H_0) = \frac{2}{10}$$

Знаменатель — формула полной вероятности.

$$\P(W) = \frac{10}{28}\cdot\frac{4}{10} + \frac{15}{28}\cdot\frac{3}{10} + \frac{3}{28}\cdot\frac{2}{10} = \frac{40 + 45 + 6}{280} = \frac{91}{280} = \frac{13}{40} = 0.325$$

Байес — разворот условия.

$$\P(H_2 \mid W) = \frac{\P(W \mid H_2)\,\P(H_2)}{\P(W)} = \frac{40/280}{91/280} = \frac{40}{91} \approx 0.4396$$
Проверка направлением

До извлечения гипотеза «оба белых» стоила $\frac{10}{28} \approx 0.3571$. Белый шар на выходе — свидетельство в её пользу, значит апостериорная вероятность обязана вырасти, а не упасть: $0.4396 > 0.3571$ ✓. Заодно $\P(W) = 0.325$ зажата между крайними правдоподобиями $0.2$ и $0.4$ — иначе где-то потерян множитель.

Где здесь счёт первого дня

Априорные вероятности гипотез — чистая комбинаторика: $\binom52 = 10$, $5 \cdot 3 = 15$ и $\binom32 = 3$ из 28 пар. Байес не отменяет счёт, а ставится поверх него, и ошибка в одном из трёх чисел ломает и знаменатель, и ответ.

Если формула не собирается — симуляция

Обоснование не сдаётся, принимается только число, поэтому задача берётся и так:

> import random
> rng = random.Random(0)
> u1 = ['W']*5 + ['B']*3
> hits = both = 0
> for _ in range(10**6):
>     t = rng.sample(u1, 2)
>     if rng.choice(['W']*2 + ['B']*6 + t) == 'W':
>         hits += 1
>         both += (t == ['W', 'W'])
> print(both / hits)      # около 0.439
> 

Миллион испытаний даёт три верных знака, четвёртый шумит: как ответ на экзамене это годится только при пустой строке, а как проверка формулы — полноценно.

EN

Hypotheses. Let $H_2$ denote the event that two white balls were transferred, $H_1$ the event that one white and one black ball were transferred, and $H_0$ the event that two black balls were transferred. These cases are mutually exclusive and exhaustive.

Prior probabilities: count pairs in the first urn. There are $\binom{8}{2} = 28$ pairs in total:

$$\P(H_2) = \frac{\binom52}{28} = \frac{10}{28}, \qquad \P(H_1) = \frac{5 \cdot 3}{28} = \frac{15}{28}, \qquad \P(H_0) = \frac{\binom32}{28} = \frac{3}{28}$$

Likelihoods. After the transfer, the second urn contains 10 balls. The number of white balls equals the 2 originally present plus the number transferred:

$$\P(W \mid H_2) = \frac{4}{10}, \qquad \P(W \mid H_1) = \frac{3}{10}, \qquad \P(W \mid H_0) = \frac{2}{10}$$

Denominator: the law of total probability.

$$\P(W) = \frac{10}{28}\cdot\frac{4}{10} + \frac{15}{28}\cdot\frac{3}{10} + \frac{3}{28}\cdot\frac{2}{10} = \frac{40 + 45 + 6}{280} = \frac{91}{280} = \frac{13}{40} = 0.325$$

Bayes' rule: reverse the conditioning.

$$\P(H_2 \mid W) = \frac{\P(W \mid H_2)\,\P(H_2)}{\P(W)} = \frac{40/280}{91/280} = \frac{40}{91} \approx 0.4396$$
Direction check

Before the final draw, the prior probability of “both transferred balls were white” was $\frac{10}{28} \approx 0.3571$. Drawing a white ball is evidence in favor of this hypothesis, so its posterior probability must increase rather than decrease: $0.4396 > 0.3571$ ✓. Also, $\P(W) = 0.325$ lies between the extreme likelihoods $0.2$ and $0.4$; otherwise, a factor has been lost somewhere.

Where the counting from Day 1 appears

The prior probabilities are pure combinatorics: $\binom52 = 10$, $5 \cdot 3 = 15$, and $\binom32 = 3$ out of 28 pairs. Bayes' rule does not replace counting; it is applied on top of it, and an error in any of these three numbers breaks both the denominator and the answer.

If the formula will not come together, simulate

Only a number is submitted, not a justification, so the problem can also be approached as follows:

> import random
> rng = random.Random(0)
> u1 = ['W']*5 + ['B']*3
> hits = both = 0
> for _ in range(10**6):
>     t = rng.sample(u1, 2)
>     if rng.choice(['W']*2 + ['B']*6 + t) == 'W':
>         hits += 1
>         both += (t == ['W', 'W'])
> print(both / hits)      # about 0.439
> 

One million trials give three reliable decimal places, while the fourth fluctuates. This is suitable as an exam answer only if you have no analytical route, but it is fully adequate as a check of the formula.

уверенность1 — угадал, 5 — уверен полностью
Задача 2Уровень YMLSВероятностьМок № 2, задача 2
RU

$X$ и $Y$ независимы и равномерно распределены на $[0, 1]$. Найдите $\P\left(X^{2} + Y^{2} < 1 \ \text{и}\ X + Y > 1\right)$.

EN

$X$ and $Y$ are independent and uniformly distributed on $[0, 1]$. Find $\P\left(X^{2} + Y^{2} < 1 \ \text{and}\ X + Y > 1\right)$.

правильный ответ 0.2854
Подсказка / Hint
RU

Нарисуй единичный квадрат, четверть круга и диагональ. Искомая область — сегмент между ними.

EN

Draw the unit square, the quarter-circle, and the diagonal. The required region lies between the latter two.

Решение / Solution
RU

Пространство исходов — единичный квадрат площади 1.

Событие — часть квадрата, лежащая внутри четверти круга радиуса 1 и выше прямой $x + y = 1$.

Площадь четверти круга: $\frac{\pi}{4}$. Площадь треугольника под диагональю внутри этой четверти: $\frac12$. Искомая область — их разность:

$$\P = \frac{\pi}{4} - \frac12 \approx 0.2854$$
Обязательно проверь симуляцией

В такой задаче легко перепутать, что из чего вычитать. Две строки кода снимают вопрос:

> import numpy as np
> p = np.random.default_rng(0).random((5_000_000, 2))
> print(((p[:,0]**2 + p[:,1]**2 < 1) & (p.sum(1) > 1)).mean())   # ~0.2854
> 
EN

The sample space is the unit square, whose area is 1.

The event is the part of the square lying inside the quarter-circle of radius 1 and above the line $x + y = 1$.

The area of the quarter-circle is $\frac{\pi}{4}$. The area of the triangle below the diagonal and inside the quarter-circle is $\frac12$. The required area is their difference:

$$\P = \frac{\pi}{4} - \frac12 \approx 0.2854$$
Always verify this with a simulation

In this type of problem, it is easy to subtract the wrong region. Two lines of code settle the issue:

> import numpy as np
> p = np.random.default_rng(0).random((5_000_000, 2))
> print(((p[:,0]**2 + p[:,1]**2 < 1) & (p.sum(1) > 1)).mean())   # ~0.2854
> 
уверенность1 — угадал, 5 — уверен полностью
Задача 3Уровень YMLSЛинал✓Мок № 2, задача 3
RU

Векторы $u$, $v$, $w$ удовлетворяют условиям

$$\|u\| = 1, \quad \|v\| = \sqrt5, \quad \|w\| = 2\sqrt2, \quad \langle u,v\rangle = 1, \quad \langle u,w\rangle = 2$$

и система $\{u, v, w\}$ линейно зависима.

Найдите наибольшее возможное значение $\langle v, w\rangle$.

EN

Vectors $u$, $v$, and $w$ satisfy

$$\|u\| = 1, \quad \|v\| = \sqrt5, \quad \|w\| = 2\sqrt2, \quad \langle u,v\rangle = 1, \quad \langle u,w\rangle = 2$$

and the set $\{u, v, w\}$ is linearly dependent.

Find the largest possible value of $\langle v, w\rangle$.

верно
Подсказка / Hint
RU

Матрица Грама, определитель равен нулю. Уравнение будет квадратным.

EN

Form the Gram matrix and set its determinant equal to zero. The resulting equation is quadratic.

Решение / Solution
RU

Обозначим $X = \langle v, w\rangle$ и составим матрицу Грама. На диагонали — квадраты длин:

$$G = \begin{pmatrix} 1 & 1 & 2 \\ 1 & 5 & X \\ 2 & X & 8 \end{pmatrix}$$

Линейная зависимость равносильна $\det G = 0$:

$$-X^{2} + 4X + 12 = 0 \;\Longleftrightarrow\; X^{2} - 4X - 12 = 0 \;\Longrightarrow\; X = 6 \ \text{или}\ X = -2$$

Наибольшее значение: 6.

Проверка. При $X = 6$ подходит конфигурация $u = (1,0)$, $v = (1,2)$, $w = u + v = (2,2)$: $\|w\|^2 = 8$ ✓, $\langle u,w\rangle = 2$ ✓, $\langle v,w\rangle = 2 + 4 = 6$ ✓

Про формулировку

В условии специально спрошено наибольшее значение — потому что корней два и оба геометрически реализуемы. Если бы спросили просто «найдите $\langle v,w\rangle$», задача была бы некорректной. Обращай внимание на такие уточнения: они подсказывают, что ответов будет несколько.

EN

Let $X = \langle v, w\rangle$ and form the Gram matrix. Its diagonal entries are the squared norms:

$$G = \begin{pmatrix} 1 & 1 & 2 \\ 1 & 5 & X \\ 2 & X & 8 \end{pmatrix}$$

Linear dependence is equivalent to $\det G = 0$:

$$-X^{2} + 4X + 12 = 0 \;\Longleftrightarrow\; X^{2} - 4X - 12 = 0 \;\Longrightarrow\; X = 6 \ \text{or}\ X = -2$$

The largest value is 6.

Check. For $X = 6$, take $u = (1,0)$, $v = (1,2)$, and $w = u + v = (2,2)$: $\|w\|^2 = 8$ ✓, $\langle u,w\rangle = 2$ ✓, $\langle v,w\rangle = 2 + 4 = 6$ ✓

Why the wording matters

The problem deliberately asks for the largest value because there are two roots and both can be realized geometrically. If the problem merely asked to “find $\langle v,w\rangle$,” it would be ill-posed. Watch for such qualifiers: they often signal that there will be multiple possible values.

уверенность1 — угадал, 5 — уверен полностью
Задача 4Уровень YMLSЛинал✓Мок № 2, задача 4
RU

Найдите длину составляющей вектора $u = (1, 2, 2)$, ортогональной вектору $v = (2, 3, 6)$.

EN

Find the length of the component of $u = (1, 2, 2)$ orthogonal to $v = (2, 3, 6)$.

верно
Подсказка / Hint
RU

Разложи $u$ на проекцию вдоль $v$ и остаток. Дальше — теорема Пифагора.

EN

Decompose $u$ into its projection along $v$ and an orthogonal remainder, then use the Pythagorean theorem.

Решение / Solution
RU$$\langle u, v\rangle = 2 + 6 + 12 = 20, \qquad \|u\| = 3, \qquad \|v\| = \sqrt{4+9+36} = 7$$

Длина проекции на направление $v$:

$$\frac{|\langle u,v\rangle|}{\|v\|} = \frac{20}{7}$$

Составляющая вдоль $v$ и ортогональная ей перпендикулярны, значит по теореме Пифагора:

$$d = \sqrt{\|u\|^2 - \left(\frac{20}{7}\right)^2} = \sqrt{9 - \frac{400}{49}} = \sqrt{\frac{441 - 400}{49}} = \frac{\sqrt{41}}{7} \approx 0.9147$$
Проверка порядка величины

Ответ обязан быть меньше $\|u\| = 3$ — ортогональная составляющая не может быть длиннее самого вектора. И раз проекция $20/7 \approx 2.86$ уже почти равна 3, остаток должен быть маленьким. $0.91$ — правдоподобно.

EN$$\langle u, v\rangle = 2 + 6 + 12 = 20, \qquad \|u\| = 3, \qquad \|v\| = \sqrt{4+9+36} = 7$$

The length of the projection onto the direction of $v$ is

$$\frac{|\langle u,v\rangle|}{\|v\|} = \frac{20}{7}$$

The component along $v$ and the component orthogonal to it are perpendicular. Therefore, by the Pythagorean theorem,

$$d = \sqrt{\|u\|^2 - \left(\frac{20}{7}\right)^2} = \sqrt{9 - \frac{400}{49}} = \sqrt{\frac{441 - 400}{49}} = \frac{\sqrt{41}}{7} \approx 0.9147$$
Magnitude check

The answer must be less than $\|u\| = 3$: an orthogonal component cannot be longer than the vector itself. Since the projection length $20/7 \approx 2.86$ is already close to 3, the remaining component should be small. A value of $0.91$ is plausible.

уверенность1 — угадал, 5 — уверен полностью
Задача 5Уровень YMLSМатанализ✓Мок № 2, задача 5
RU

Вычислите $\displaystyle\lim_{x \to 0}\frac{\arctan x - x}{x^{3}}$.

EN

Evaluate $\displaystyle\lim_{x \to 0}\frac{\arctan x - x}{x^{3}}$.

верно
Подсказка / Hint
RU

Из арктангенса вычли его линейную часть — значит нужен кубический член разложения.

EN

The linear term of $\arctan x$ has been subtracted, so the cubic term of the expansion is needed.

Решение / Solution
RU$$\arctan x = x - \frac{x^3}{3} + o(x^4)$$

Числитель:

$$\arctan x - x = -\frac{x^3}{3} + o(x^4)$$$$\lim_{x \to 0}\frac{-x^3/3}{x^3} = -\frac13 \approx -0.3333$$
Признак типа

Из функции вычитают ровно её линейную часть — верный сигнал, что надо разлагать до кубического члена. Если оставить только $\arctan x \sim x$, получится $\frac{0}{x^3}$ и покажется, что предел равен нулю.

EN$$\arctan x = x - \frac{x^3}{3} + o(x^4)$$

The numerator is

$$\arctan x - x = -\frac{x^3}{3} + o(x^4)$$$$\lim_{x \to 0}\frac{-x^3/3}{x^3} = -\frac13 \approx -0.3333$$
Pattern recognition

The function's linear term is subtracted exactly. This is a clear signal that the expansion must be carried through the cubic term. If you use only $\arctan x \sim x$, you obtain $\frac{0}{x^3}$ and may incorrectly conclude that the limit is zero.

уверенность1 — угадал, 5 — уверен полностью
Задача 6Уровень YMLSМатанализМок № 2, задача 6
RU

Вычислите $\displaystyle\int_0^{\pi/2}\sin^{4}x\,dx$.

EN

Evaluate $\displaystyle\int_0^{\pi/2}\sin^{4}x\,dx$.

правильный ответ 0.5890
Подсказка / Hint
RU

Чётная степень синуса — понижай формулой двойного угла. Дважды.

EN

For an even power of sine, apply the power-reduction identity twice.

Решение / Solution
RU

Первое понижение: $\sin^2 x = \dfrac{1 - \cos 2x}{2}$, значит

$$\sin^4 x = \left(\frac{1 - \cos 2x}{2}\right)^{2} = \frac{1 - 2\cos 2x + \cos^{2}2x}{4}$$

Второе понижение: $\cos^2 2x = \dfrac{1 + \cos 4x}{2}$, значит

$$\sin^4 x = \frac{1}{4}\left(1 - 2\cos 2x + \frac{1 + \cos 4x}{2}\right) = \frac38 - \frac{\cos 2x}{2} + \frac{\cos 4x}{8}$$

Интегрируем на $[0, \pi/2]$. Оба косинуса дают ноль (их первообразные — синусы, обращающиеся в ноль на концах), остаётся только константа:

$$\int_0^{\pi/2}\sin^4 x\,dx = \frac38 \cdot \frac{\pi}{2} = \frac{3\pi}{16} \approx 0.5890$$
Формула Валлиса для проверки$$\int_0^{\pi/2}\sin^{2n}x\,dx = \frac{(2n-1)!!}{(2n)!!}\cdot\frac{\pi}{2}$$

При $n = 2$: $\frac{3 \cdot 1}{4 \cdot 2}\cdot\frac{\pi}{2} = \frac{3\pi}{16}$ ✓

Стоит запомнить хотя бы частные случаи: $\int_0^{\pi/2}\sin^2 = \frac{\pi}{4}$, $\int_0^{\pi/2}\sin^4 = \frac{3\pi}{16}$.

EN

First reduction: $\sin^2 x = \dfrac{1 - \cos 2x}{2}$, hence

$$\sin^4 x = \left(\frac{1 - \cos 2x}{2}\right)^{2} = \frac{1 - 2\cos 2x + \cos^{2}2x}{4}$$

Second reduction: $\cos^2 2x = \dfrac{1 + \cos 4x}{2}$, hence

$$\sin^4 x = \frac{1}{4}\left(1 - 2\cos 2x + \frac{1 + \cos 4x}{2}\right) = \frac38 - \frac{\cos 2x}{2} + \frac{\cos 4x}{8}$$

Integrate over $[0, \pi/2]$. Both cosine terms integrate to zero: their antiderivatives are sine functions that vanish at both endpoints. Only the constant term remains:

$$\int_0^{\pi/2}\sin^4 x\,dx = \frac38 \cdot \frac{\pi}{2} = \frac{3\pi}{16} \approx 0.5890$$
Check using Wallis' formula$$\int_0^{\pi/2}\sin^{2n}x\,dx = \frac{(2n-1)!!}{(2n)!!}\cdot\frac{\pi}{2}$$

For $n = 2$: $\frac{3 \cdot 1}{4 \cdot 2}\cdot\frac{\pi}{2} = \frac{3\pi}{16}$ ✓

It is useful to remember at least the special cases $\int_0^{\pi/2}\sin^2 = \frac{\pi}{4}$ and $\int_0^{\pi/2}\sin^4 = \frac{3\pi}{16}$.

уверенность1 — угадал, 5 — уверен полностью
Задача 7Уровень YMLSАлгоритмы✓Мок № 2, задача 7
RU

Есть шесть куч размерами $[7, 15, 6, 21, 9, 13]$ и $h = 9$ часов. За час можно взять не более $k$ единиц из одной кучи (даже если в куче осталось меньше, час тратится целиком).

Найдите минимальное целое $k$, при котором все кучи будут разобраны за $h$ часов.

EN

There are six piles of sizes $[7, 15, 6, 21, 9, 13]$ and $h = 9$ available hours. During each hour, at most $k$ units may be removed from one pile. Even if fewer than $k$ units remain in that pile, the entire hour is used.

Find the smallest integer $k$ for which all piles can be emptied within $h$ hours.

верно
Подсказка / Hint
RU

Бинарный поиск по ответу. Предикат: $\sum\lceil p_i/k\rceil \le h$.

EN

Use binary search on the answer. The predicate is $\sum\lceil p_i/k\rceil \le h$.

Решение / Solution
RU
def hours(k):
    return sum(-(-p // k) for p in piles)

lo, hi = 1, max(piles)
while lo < hi:
    mid = (lo + hi) // 2
    if hours(mid) <= h: hi = mid
    else:               lo = mid + 1
print(lo)     # 11

Ответ: 11.

Проверка: при $k = 11$ получаем $1 + 2 + 1 + 2 + 1 + 2 = 9$ ✓; при $k = 10$ получаем $1 + 2 + 1 + 3 + 1 + 2 = 10 > 9$ ✗

Сложность $O(n\log(\max p))$. Наивный перебор всех $k$ прошёл бы на этих данных, но не на реальных ограничениях, где $p_i$ доходят до $10^9$.

EN
def hours(k):
    return sum(-(-p // k) for p in piles)

lo, hi = 1, max(piles)
while lo < hi:
    mid = (lo + hi) // 2
    if hours(mid) <= h: hi = mid
    else:               lo = mid + 1
print(lo)     # 11

Answer: 11.

Check: for $k = 11$, the required time is $1 + 2 + 1 + 2 + 1 + 2 = 9$ hours ✓; for $k = 10$, it is $1 + 2 + 1 + 3 + 1 + 2 = 10 > 9$ hours ✗.

The time complexity is $O(n\log(\max p))$. A naive search through all values of $k$ would work for these particular data, but not under realistic constraints where $p_i$ may be as large as $10^9$.

уверенность1 — угадал, 5 — уверен полностью
Задача 8Уровень YMLSАлгоритмыМок № 2, задача 8
RU

Сколько существует двоичных строк длины 15, в которых нет трёх единиц подряд?

EN

How many binary strings of length 15 contain no three consecutive ones?

правильный ответ 10609
Подсказка / Hint
RU

Динамика по числу единиц в конце строки. Состояний будет три.

EN

Use dynamic programming with the number of trailing ones as the state. There are three states.

Решение / Solution
RU

Состояние. Пусть $f(n)$ — число подходящих строк длины $n$. Смотрим на конец строки: она заканчивается либо нулём, либо 01, либо 011. Больше двух единиц подряд быть не может.

  • заканчивается на 0 → перед ним любая подходящая строка длины $n-1$;
  • заканчивается на 01 → перед ними любая подходящая строка длины $n-2$;
  • заканчивается на 011 → перед ними любая подходящая строка длины $n-3$.
$$f(n) = f(n-1) + f(n-2) + f(n-3)$$

База: $f(0) = 1$, $f(1) = 2$, $f(2) = 4$ (все строки длины 2 подходят).

Это числа трибоначчи:

$$1,\ 2,\ 4,\ 7,\ 13,\ 24,\ 44,\ 81,\ 149,\ 274,\ 504,\ 927,\ 1705,\ 3136,\ 5768,\ \mathbf{10609}$$$$f(15) = 10\,609$$
f = [1, 2, 4]
for i in range(3, 16):
    f.append(f[-1] + f[-2] + f[-3])
print(f[15])    # 10609
Обобщение, которое стоит увидеть

«Нет двух единиц подряд» → Фибоначчи ($f(n) = f(n-1) + f(n-2)$). «Нет трёх единиц подряд» → трибоначчи ($f(n) = f(n-1) + f(n-2) + f(n-3)$). «Нет $k$ единиц подряд» → сумма $k$ предыдущих.

Рассуждение всегда одно: смотрим на конец строки и разбираем случаи по числу завершающих единиц. Это же и есть определение состояния в динамике.

EN

State. Let $f(n)$ be the number of valid strings of length $n$. Consider the end of a string: it ends in either 0, 01, or 011, since there cannot be more than two consecutive ones.

  • ends in 0 → it is preceded by any valid string of length $n-1$;
  • ends in 01 → it is preceded by any valid string of length $n-2$;
  • ends in 011 → it is preceded by any valid string of length $n-3$.
$$f(n) = f(n-1) + f(n-2) + f(n-3)$$

Base cases: $f(0) = 1$, $f(1) = 2$, and $f(2) = 4$; all strings of length 2 are valid.

These are the Tribonacci numbers:

$$1,\ 2,\ 4,\ 7,\ 13,\ 24,\ 44,\ 81,\ 149,\ 274,\ 504,\ 927,\ 1705,\ 3136,\ 5768,\ \mathbf{10609}$$$$f(15) = 10\,609$$
f = [1, 2, 4]
for i in range(3, 16):
    f.append(f[-1] + f[-2] + f[-3])
print(f[15])    # 10609
A useful generalization

“No two consecutive ones” gives the Fibonacci recurrence $f(n) = f(n-1) + f(n-2)$. “No three consecutive ones” gives the Tribonacci recurrence $f(n) = f(n-1) + f(n-2) + f(n-3)$. “No $k$ consecutive ones” gives the sum of the previous $k$ terms.

The reasoning is always the same: inspect the end of the string and split into cases according to the number of trailing ones. That is precisely how the dynamic-programming state is defined.

уверенность1 — угадал, 5 — уверен полностью

Протокол

регламент
RU
Регламент онлайн-этапа

Восемь задач, четыре часа, одна попытка. Окно открыто с 27 августа по 10 сентября, попытка по плану — 4 сентября в 10:00. Пятое сентября — запасной день попытки: он держится свободным на случай сбоя 4-го, и никакой учебной нагрузки на него не планируется. Принимается только числовой ответ, без обоснования.

Разметка четырёх часов

ВремяЧто делаешьПравило
0:00–0:10Читаешь все восемь задачНи одного вычисления. На каждую задачу три вещи: метка, оценка, слово темы
0:10–1:30Решаешь все AПо возрастанию оценки, начиная с самой короткой. На первой проверяется формат ответа
1:30ПерерывМинута: встал, отвёл глаза от экрана, сел
1:30–3:00Решаешь все BОтсечка захода — 12 минут, потолок задачи — 25 минут суммарно
2:30ПерерывТри минуты и вода
3:00–3:40C и возвратыЗдесь работает симуляция и численный счёт
3:40–4:00Закрытие листаТри прохода строго в порядке: пустые поля, формат, правдоподобность. Новых решений нет

Первые десять минут — разметка, ни одного вычисления

На каждую из восьми задач записываются три вещи:

  • метка A (вижу решение целиком), B (вижу тему и первый ход), C (не вижу даже темы);
  • оценка в минутах — сколько, по-твоему, займёт;
  • слово темы — одно слово, к чему задача относится.

Это одинаково на моке 1, на моке 2 и на экзамене. Оценки нужны для коэффициента оптимизма, поэтому собираются всегда.

Восемь правил

  1. Порядок взятия задач. По возрастанию оценки внутри метки: сначала все A, начиная с самой короткой, потом B, потом C. Нумерация задач не значит ничего — составители не сортируют задачи по сложности.
  2. Отсечка захода — 12 минут. Задача не сдвинулась за 12 минут одного захода: ставлю метку «возврат», одной строкой пишу, на чём встал, и ухожу. Метка задачи при этом не меняется. Возврат — только после полного круга по всем восьми.
  3. Отсев — после первого захода. Если после первого захода не можешь одним предложением назвать, чего именно не хватает, задача уходит в конец очереди и берётся последней. Отсев меняет очередь, но не закрывает задачу: закрывает только потолок 25 минут.
  4. Потолок задачи — 25 минут суммарно. 25 минут суммарно по всем заходам: пишу в поле разумную оценку и закрываю насовсем. Возврата к ней больше нет. Никаких «плюс пять минут»: 25 — это выход, а не предупреждение.
  5. Перерывы — два, по часам, а не по самочувствию. На 1:30 — минута: встал, отвёл глаза от экрана, сел. На 2:30 — три минуты и вода. Усталость снижает точность сильнее, чем незнание темы.
  6. Симуляция — легальное оружие. Обоснование не требуется, значит численный ответ равноценен аналитическому.
  7. Последние 20 минут — три прохода строго в этом порядке. Первый — пустые поля: в каждое пустое поле разумная оценка; пустая строка стоит ровно столько же, сколько неверный ответ, а штрафа за неверный нет. Второй — формат всех восьми. Третий — правдоподобность: вероятность в $[0,1]$, счёт — целое неотрицательное, среднее внутри диапазона значений, $|\cos\varphi| \le 1$, порядок величины. Любое число, вписанное на первом проходе, обязано пройти второй и третий вместе со всеми остальными.
  8. Формат ответа. Четыре знака после запятой, точка как разделитель, без пробелов и единиц. Целые — без десятичной части, знак приближённого равенства не пишется. Проверь на первой же задаче, как система принимает ответ.

Коэффициент оптимизма

Коэффициент оптимизма = фактическое время, делённое на оценку из разметки. Считается по задачам, которые доведены до ответа. Собирается на моке 1 (день 7) и уточняется на моке 2 (день 13); на экзамене все прикидки времени умножаются на него.

Три диагноза ошибки

Разбор каждой незакрытой или неверной задачи даёт ровно один диагноз:

  • не опознал тему — не понял, к чему задача относится;
  • не знал метод — тему опознал, приёма не знал;
  • сломался на исполнении — знал метод, потерял в счёте, знаке, границе или формате.

Триада одна для дней 7, 13 и 14. Никаких синонимичных переименований.

Техническая проверка

Настоящая техническая проверка — 3 сентября (день 13, отдельный слот 15 минут): интерфейс Яндекс Контеста, ввод дробного числа, запуск Python, импорт numpy и sympy. Утром 4 сентября — только короткая проверка «всё ли открыто», 5 минут, без настройки.

Здесь только регламент

Правила выше одинаковы на моке 1, на моке 2 и на экзамене: дни повторяют их теми же словами и теми же числами, а не пересказывают заново. Поведение под таймером разобрано в самих днях. День 7 — как за первые десять минут составить план для восьми задач. День 13 — как заполнить лист ответов за последние двадцать минут. День 14 — что делать на двадцать пятой минуте задачи и при панике. Там же таблицы триггеров «увидел — первый ход».

EN
Online-stage rules

Eight problems, four hours, one attempt. The window is open from August 27 through September 10; the planned attempt is September 4 at 10:00. September 5 is the backup attempt day: keep it free in case September 4 fails, with no study load planned. Only a numerical answer is accepted, without justification.

How to spend the four hours

TimeWhat you doRule
0:00–0:10Read all eight problemsNo calculations. For each problem, record three things: label, estimate, and topic word
0:10–1:30Solve all A problemsIn increasing order of estimate, starting with the shortest. Check the answer format on the first one
1:30BreakOne minute: stand up, look away from the screen, sit down
1:30–3:00Solve all B problemsEntry cutoff: 12 minutes; problem cap: 25 minutes in total
2:30BreakThree minutes and water
3:00–3:40C problems and returnsThis is where simulation and numerical calculation are useful
3:40–4:00Close the sheetThree passes, strictly in order: blank fields, format, plausibility. No new solutions

The first ten minutes: mark everything, calculate nothing

Record three things for each of the eight problems:

  • Label A (I can see the whole solution), B (I see the topic and first move), or C (I cannot even see the topic);
  • Estimate in minutes—how long you think it will take;
  • Topic word—one word describing what the problem is about.

Use this on Mock 1, Mock 2, and the exam. Estimates are needed for the optimism coefficient, so always record them.

Eight rules

  1. Order of attack. Within each label, work in increasing order of estimated time: all A problems first, starting with the shortest, then B, then C. Problem numbers mean nothing—the authors do not sort problems by difficulty.
  2. Entry cutoff: 12 minutes. If a problem has not moved after 12 minutes in one sitting, mark it “return,” write in one line what stopped you, and move on. The problem’s label does not change. Return only after a full pass through all eight.
  3. Defer after the first sitting. If after the first sitting you cannot name in one sentence exactly what is missing, move the problem to the end of the queue and take it last. Deferral changes the queue but does not close the problem; only the 25-minute cap closes it.
  4. Problem cap: 25 minutes total. Across all sittings, after 25 minutes write a reasonable estimate in the field and close the problem permanently. Do not return to it. There is no “five more minutes”: 25 is an exit, not a warning.
  5. Two timed breaks, not breaks by feeling. At 1:30 take one minute: stand, look away from the screen, sit. At 2:30 take three minutes and drink water. Fatigue reduces accuracy more than lack of topic knowledge.
  6. Simulation is a legitimate tool. No justification is required, so a numerical answer is as valid as an analytical one.
  7. The last 20 minutes: three passes in exactly this order. First, blank fields: put a sensible estimate in every empty field; a blank line is worth exactly as much as a wrong answer, and there is no penalty for a wrong one. Second, format all eight answers. Third, plausibility: probability in $[0,1]$, a count a nonnegative integer, an expectation within its range, $|\cos\varphi|\le1$, and the right order of magnitude. Any number entered on the first pass must pass the second and third passes along with the rest.
  8. Answer format. Four digits after the decimal point, a period as separator, no spaces or units. Integers have no decimal part, and do not write an approximate-equality sign. Check on the first problem how the system accepts the answer.

Optimism coefficient

Optimism coefficient = actual time divided by the estimate recorded during marking. Calculate it from problems brought to an answer. Collect it on Mock 1 (day 7) and refine it on Mock 2 (day 13); on the exam, multiply all time estimates by it.

Three error diagnoses

Every unfinished or incorrect problem receives exactly one diagnosis:

  • did not recognize the topic—you did not understand what the problem concerned;
  • did not know the method—you recognized the topic but not the technique;
  • execution broke down—you knew the method but lost the count, sign, boundary, or format.

Use the same triad on days 7, 13, and 14. Do not rename these categories with synonyms.

Technical check

The real technical check is September 3 (day 13, a separate 15-minute slot): the Yandex Contest interface, entering a decimal, launching Python, and importing numpy and sympy. On the morning of September 4, do only a short five-minute “is everything open?” check, with no setup.

This section contains rules only

The rules above are identical for Mock 1, Mock 2, and the exam: the day pages repeat the same words and numbers rather than retelling them. Timed behavior is discussed on the day pages themselves. Day 7 is about planning for eight problems in the first ten minutes. Day 13 is about filling the answer sheet in the last twenty minutes. Day 14 is about what to do at minute 25 of a problem and during panic. Those pages also contain “saw it—first move” trigger tables.