D - Triangle Card Game Editorial by i_am_noob


Call an Alice’s card good if Alice wins if she eats that card as the first card, and Bob eats his smallest card.

Then we can assume that Alice eats the greatest good card.

Proof: Obviously Alice can only eat good cards as the first card. Let the greatest good card be \(a\), and any other good card be \(a'\). If Bob eats card \(b\), and \(b \leq a\), then Alice wins because \(a\) is good. If \(b>a\) and Alice loses, then Alice will also lose to \(b\) if Alice eats \(a'\) instead of \(a\).

posted:
last update: