<aside> <img src="/icons/chat_blue.svg" alt="/icons/chat_blue.svg" width="40px" />
For feedback or questions, please leave a comment on the Codeforces blog
</aside>
Hi! Since I couldn’t find an official one, I decided to post a full step-by-step editorial for Balkan OI 2025 Tiling Madness - one of my favorite problems from last year’s OIs.
First of all, let’s understand what the problem asks. It defines a $2N$-mino as a connected shape consisting of $2N$ squares. A $2N$-mino is valid if we can place $N$ copies of it so that they don’t overlap and there is a $N \times N$ square completely covered by them. We have to find as many unique valid $2N$-minoes as possible.
When we check the input files, we notice there is only one testcase (apart from the example), where $N=7$. So, we need to find as many valid $14$-minoes.
Instead of having subtasks, the number of points we get depends on how many different solutions we find. In the scoring section we can find details on how many points we get depending on the number of solutions.
This problem is output-only, which means that instead of submitting our code, we have to submit a text file containing the output. In the problem attachments we’ll find text files containing the input for each testcase.
The only technical difficulty of output-only problems is reading from and printing to a file. This is really easy to do in C++, by writing these two lines in the beginning of main():
ifstream cin("in.txt");
ofstream cout("out.txt");
Now we can use cin and cout like normal, except they will use in.txt for input and out.txt for output, instead of the terminal.
Output only problems are usually constructive. Since they have started to frequently appear in olympiads, including IOI, learning how to solve an output only problem is really important.
Why would a problem be output-only instead of batch? After all, every output-only problem could’ve been a batch problem. There are three main differences: