AtCoder Beginners Contest 088[A to C]

Tasks

 

A. Infinite Coins … Simple print modulus result

 

B. Card Game For Two … As the questions says “When both players take the optimal strategy to maximize their scores”, it means both player takes the biggest card on their turn. Sort the card list in descending order, and use python list slice ([::2] the last 2 means every other cards) to create the resulting card list for both users.

 

C. Takahashi’s Information … As possible number of ai is not so big, I use bruteforce for possible a1, so the cost is 100x3x3. Once a1 value is fixed, the other number can be calculated. Compare the resulting list (from the assumption) and the original list.