Modular operation thinking in split apples

    Two people, A and B, take turns taking apples. Each person takes at least 1 and 5 at most. There are 100 apples in total. If the last apple won is the champion, is there any way to make A win the championship?
    Method: adopt reverse thinking + modulo operation
    assuming that there are only 5+1 = 6 apples in the end. At this time, let B take first, and A second, and A can win the championship;
    however, 100%6 = 16...4, now there are 100 If there are 4 more apples,
    you need A to take the 4 more, then B takes n (1<=n<=5), and A then takes (6-n), that is, the remaining apples The number can be divisible by 6, and the cycle repeats. In the last round, there are 6 apples, and A wins the championship.

Guess you like

Origin blog.csdn.net/sanqima/article/details/108137841