Why? Your logic have AC?
yesss
print(n%m)
Damn… weak af… Can you please help me in this too… please please please
I divide the n/m and then checked whether it’s divisible by 2 or not. It passed half of the test cases… where must I have gone wrong?
Not weak, Wrong test cases LOL.
They also forgot it.
Test Case #3 fails with my soln
bhai bhai
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…