Let $n \ge 2$ be a positive integer. The game starts with $2n$ piles of stones, each containing a single stone. Players $A$ and $B$ alternately merge two piles of their choice, until there are only two piles left. $A$ wins if those final piles are both even-sized; and $B$ wins if both are odd-sized. A has first move
My first instinct is that $A$ has the winning strategy, by attempting to apply the principle of variants (i.e. monovariants and invariants). However, I'm unable to find what the invariant or monovariant is in this problem to draft a general solution.
What is the answer?
The second player wins.
The first player must merge two odd piles, creating an even pile. The second player responds by merging an odd pile with the even pile. Originally, there were $2n$ odd piles (and zero even piles), and after these two moves, there are $2(n-1)$ odd piles (and zero even piles). Therefore, the second player can repeat this strategy until there are four odd piles and zero even piles. From here, the first player is forced to merge two odd piles, leaving the situation $$ \text{odd}, \text{odd}, \text{even} $$ for the second player. Then, the second player has two options, one of which ends the game with $\text{odd}, \text{odd}$, and the other which ends the game with $\text{even},\text{even}$. Therefore, the second player can force whichever ending they prefer; if $A$ goes second, she uses this strategy to force $\text{even},\text{even}$, and if $B$ goes second, he uses this strategy to force $\text{odd},\text{odd}$.