New Year Contest

for Andrey’s friends

Task Solutions

This page contains the author’s solution ideas for the New Year Contest that took place on January 1, 2026. If you haven’t solved the tasks yet, I suggest you solve them first (even if you didn’t participate in the contest itself), and only then read the write-ups. To do that, register on the main page at 2026.andgein.ru. There you can also read what this New Year Contest of ours is all about.

Even though there are no ready-made programs here, below you’ll find the contents of the levels and solution ideas for all tasks — which means a huge number of spoilers. Be careful!

Attention! This page contains answers to all tasks. Please, if you’ve already seen an answer, do not submit it under your own name for judging. You can and should still solve the tasks, but not by copying answers from this page :-)

Jump to the write-up for a specific task:

  1. Uneval
  2. Bulls and Cows
  3. Brainfuck
  4. LEGO one, LEGO two
  5. Scrambled PNG

1. Uneval

In this task, you had to construct an arithmetic expression of a given length (or shorter) whose value equals a given integer. At the same time, you were not allowed to use certain characters in the expression — for example, some digits and the “+” symbol. The target integer, the length limit, and the set of forbidden characters changed from level to level: on the first level, for instance, you had to get 2026 from an expression no longer than 7 characters, without using the digits 2, 0, and 6.

The answer was validated using Python’s eval() function, with additional restrictions: you could not import modules, call functions, or access attributes.

Show spoilers

2. Bulls and Cows

In this task, you had to guess a sequence of numbers chosen in the game “Bulls and Cows”, given all the guesses and the number of bulls/cows for each guess.

If there were multiple possible sequences, as a small extra twist you had to find the lexicographically smallest one.

Show spoilers

3. Brainfuck

In this task, you had to write a fairly short program in the most famous esoteric programming language, Brainfuck. The program had to print a single string, but that string had to depend on (and only on!) what you fed the program as input. For example, if the input is “what” the program should output “contest”, and if the input is “where” — “2026.andgein.ru”.

Show spoilers

4. LEGO one, LEGO two

In this task, you just had to detect and count LEGO® minifigures in images like this:

Show spoilers

5. Scrambled PNG

The PNG file was split into equal-sized chunks (for example, 4713 bytes each), and the chunks were shuffled. Reconstruct the correct order of the chunks and see what’s shown in the image.

Show spoilers

Warning: spoilers!

Please do not submit the answer you’ve seen under your own name.
If you want to keep solving the tasks yourself, close the popup and don’t look at the answers.