A. Ideal Generator
We can notice that when $$$n$$$ is even, it can only generate an even number: the sum of the first half is exactly the same as the second half. However, when $$$n$$$ is odd, we can generate any number by placing $$$n-k+1$$$ in the middle and $$$1$$$ in other positions.
B. Expensive Number
We can prove that the final cost of the number must be 1, and it is between 1 and 9 (possibly with leading zeros). We don't need to remove the leading zeros.
So, which position should we reserve? Greedily, we should reserve as many leading zeros as possible. Therefore, we can reserve the last non-zero position and the zeros before it.
C. Simple Repetition
When $$$y \gt 1$$$ and $$$x \neq 1$$$, the number can be divided by $$$x$$$.
D. Skibidi Table
Consider dividing the current grid into 4 areas. In which area does our position lie?
Try to solve this problem using recursion.
E. Min Max MEX
Stop learning useless algorithms, go solve some problems, and learn how to use binary search.
How do we check whether the mex of a subarray is greater than $$$x$$$? When all the numbers from $$$0$$$ to $$$x-1$$$ have appeared in it.
Greedily split the array.
F. Hackers and Neural Networks
When should we output -1?
When the array is full (though this may not be entirely correct), we can replace one position with a blank, then fill it with the correct word.
Initially, when the array is completely blank, we choose a neural network. We will need to perform $$$n$$$ operations to fill all the correct words into the array in the worst case.
Consider hint 1. Which neural network should we choose first?
G. Shorten the Array
This is a classic problem.If you don't know how to solve it, you should learn about Trie.









Really nice hints, problem D might be my favorite. Also, a really nice Um_nik reference right there :)
It is a good job.
Could you please tell why n(logn)^2 gives tle in E
set has a really large constant factor
I thought this constant issue doesn't appear till 2100. Last time I faced something similar was in 2085E - Serval and Modulo.