Discord

Checklist VsOSh AI 2026 School Stage (Moscow), grades 9–11 · Task 7

Special Decision Tree

Russian title: Специальное дерево принятия решений

Count the leaves of a full binary decision tree that remain reachable after two edge probabilities are set to zero.

  • Algorithmic programming (combinatorics on trees)
  • Russian original · English translation

The task

A full binary decision tree of depth n has probability 1/2 on every edge. Two edges are set to probability 0: the a-th edge on the always-left path and the b-th edge on the always-right path; their sibling edges get probability 1, all others stay 1/2.

Count the leaves that still have non-zero probability.

Abridged and translated by SOTA from the official Russian materials. The official statement has the exact rules, and it wins wherever this summary differs.

In English

This task was published in Russian. SOTA translated its 4 files into English on 16 September 2026.

Read the task statement in English 500 words

Special Decision Tree

English translation by SOTA – AI Community of the Russian original. Organisers who would like this translation removed can email [email protected].

Task 7 of the school stage (Moscow) of the All-Russian School Olympiad (VsOSh) 2025/26 in artificial intelligence, grades 9–11. Original: tasks-ai-9-11-sch-msk-25-26.pdf.

Special decision tree

Input file name: standard input
Output file name: standard output
Time limit: 1 second
Memory limit: 256 megabytes

You are given a complete binary decision tree of depth nn. Exactly nn steps are taken from the root to a leaf. At each step, one of two decisions is made: go left or go right. Initially, both options are equally likely: each edge has probability 1/21/2.

Someone modified the tree and changed two edge probabilities to 0:

  • the first edge is the aa-th edge on the "always left" path (the edge between levels a1a - 1 and aa if you choose left at every step from the root);
  • the second edge is the bb-th edge on the "always right" path (the edge between levels b1b - 1 and bb if you choose right at every step from the root).

All the other edges still have probability 1/21/2 (except for the edges that have lost their neighbouring edge: their probability is now equal to one).

The outcomes in this tree are its leaves (the vertices on the very bottom level). The probability of each outcome is the product of the probabilities along the path to the corresponding leaf.

You need to determine how many different outcomes (leaves of the tree) still have non-zero probability.

Input format

The only line contains three integers nn, aa, bb (1n601 \le n \le 60, 1a,bn1 \le a, b \le n).

Output format

Output one integer: the number of leaves that remain reachable (that is, that correspond to paths of non-zero probability).

Note

[Figure: see page 3 of the original PDF. Transcription: a complete binary tree of depth 3 in which the edge from the root to its right child and the edge from the root's left child to its own left child are crossed out in red. Of the eight leaves, the third and fourth from the left are green (reachable); the other six are red and marked with a cross.]

In the first test example, only 2 outcomes remain reachable.

Translator's note: the paper does not print the test examples themselves.

Translator's note: the statement paper gives only the total for the olympiad (112 points), and the official solutions state no points for this task; the total minus the maxima of the other seven tasks (92 points) leaves 20.

Translated by SOTA. The Russian original is the official version and wins wherever the two differ. Translated from the statement and solution PDFs of the Moscow school stage (grades 9–11) on vos.olimpiada.ru. The papers do not print the test examples or any points for this task; the example tree figure is described in text. If you organise this olympiad and would like the translation removed, email [email protected] and we will take it down.

At a glance

You get
Standard input: n, a, b (1 ≤ n ≤ 60, 1 ≤ a, b ≤ n).
You submit
One integer: the number of reachable leaves.
Scoring
Program checked on tests (per-test scoring not stated in the statement file).
Rules
  • Time limit 1 s; memory limit 256 MB.
Format
School stage (Moscow), started 24 October 2025, grades 9–11; individual; online testing system; maximum 112 points for the paper.

Details

Year
2026, Moscow, Russia (online testing system)
Round
School Stage (Moscow), grades 9–11 · Task 7
Language
Russian; English translation by SOTA
License
Not stated by the source