We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- "even" operations (e.g. ..., 2^62->2^61, 2^60->2^59, ..., 2^4->2^3, 2^2->2^1, STOP). He's named "even" player below.
- "odd" operations (e.g. ..., 2^61->2^60, ..., 2^3->2^2, 2^1->2^0, STOP). He's named "odd" player below.
.
Statement 2.
In addition to statement 1, first player (i.e. Louise) can initially hold a number (called "start" number) different from a "2-power" numbers. In this case, first player performs an ADDITIONAL pre-operation to reduce "start" number to the largest "2-power" number.
.
Statement 3.
"Odd" player ALWAYS wins because he perform the last valid turn (i.e. from 2^1 to 2^0). In interest of clarity:
- "even" player is therefore re-named "loser-even" player.
- "odd" player is therefore re-named "winner-odd" player.
.
This said, for ALL "start" numbers between 2^62 and 2^63 (CAUTION: including 2^62 and excluding 2^63) first player (i.e. Louise) will be the "loser-even" player.
.
In conclusion, for first, second and fourth inputs, output should be always "Richard".
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Counter game
You are viewing a single comment's thread. Return to all comments →
Statement 1.
A player ALWAYS perform:
.
Statement 2.
In addition to statement 1, first player (i.e. Louise) can initially hold a number (called "start" number) different from a "2-power" numbers. In this case, first player performs an ADDITIONAL pre-operation to reduce "start" number to the largest "2-power" number.
.
Statement 3.
"Odd" player ALWAYS wins because he perform the last valid turn (i.e. from 2^1 to 2^0). In interest of clarity:
.
This said, for ALL "start" numbers between 2^62 and 2^63 (CAUTION: including 2^62 and excluding 2^63) first player (i.e. Louise) will be the "loser-even" player.
.
In conclusion, for first, second and fourth inputs, output should be always "Richard".