This is the editorial for the Unofficial Div 4 Round #2 created by SlavicG and mesanu.
We hope everyone had fun and enjoyed the contest!
Problem A — Catching the Impostor.
Problem B — Epic Permutation
Problem C — Similar Arrays
Problem D — Sanda's Job
Problem E — Count Substrings
Problem F — Game on Grid
If n = 0 (mod2) then you can split the grid into sections of squares with 4 smaller squares each, wherever Bob colours he will at most nullify 4 squares. If n = 2 (Mod 4) then if Bob always plays correct(nullifying 4 squares every moves) Alice still wins because they will play for an odd number of moves.
If n = 0 (mod 4) then then Bob's strategy is to just eliminate one colour. Because Alice needs all colours present to move the game will end in n28 moves, this number being even so because playing optimally they can at most get 4 squares each move each will get the same number of squares.
If n is odd, then Bob will focus on the colour that is least present ( even column, even row ). Alice will get 4⋅(⌊(n−1)28⌋+1) and Bob will get 4⋅⌊(n−1)28⌋+2⋅n−1 so Bob will get more for n≥3.
Exception for n=1 but its easy to see that Bob would win.