whats your solution ?
number of 1ās=k and then (n-k)%m
Local contest requires local solution
XD
check n%(m+1).
if 0 then no;
else yes;
Yes. This gave AC. Can you please explain? Thanks
Can you explain?
Yes , Its simple.
Whoever remains with m+1 tiles will loose surely because he canāt pick all the tiles and must pick at least one tile and hence the opponent can pick all the remaining tiles.
Therefore optimal game play is to play such that the other player is left with m+1 tiles.
Thanks a lot bro. Will this algo work out?
First timeā¦ the player takes m-1ā¦ then from thatā¦ even if the player takes m cardsā¦ the first player would end up winning. Will this theory work out? Thank you so much for reply
Nope.
The only point is to land your opponent on m+1 cards.
So if the no. of cards is 2m+2 or 3m+3 or k*(m+1) initially no matter what the first player choose the second player would always leave first player with m+1 cards in the end.
Bro. . How do you even think of these solutions bro. Please show me the treasure
No treasure .
Initially logic and observation will help more . Later through upsolving you can learn new data structures and algos.
Note - I suck at upsolving .
No you donāt
I_returns returnsā¦