Getting wrong answer

I am trying to solve this question…
https://codeforces.com/contest/1397/problem/D
What approch i have followed is that first pick the piles with maximum number of stones…both for “T” and “HL”…
and now i counted number of stones left with “T” and “HL”… based on that i have given the answer…
This is my solution…
https://codeforces.com/contest/1397/submission/99541133
What wrong with it…
please see it…

Hey @ashishnnnnn
Please explain ur logic in detail
U can add comments in ur code :slight_smile:

I have explained here with the help of comments

Hey @ashishnnnnn
If I am understanding the question right then it means that we can not select a pile which is chosen in immediate previous turn but that does not mean that if some pile is chosen by A then it cant be chosen by B after 2 or more turns .

For this
1
3
2 2 2
HL wins but acc to ur code Twins because instead of immediate previous u are considering all prev

Ooo… Here previous turn means just previous turn… I thought that it is talking about all previous turn any player has made…
Am i right now??

Yeah according to question language otherwise they must have mentioned turns

Thanks again :slight_smile:
I had got the question in wrong way… :slight_smile:

1 Like

One thing i want to ask …
As we know that to be good at c.p… it will take time.
What happening with me… is that i am only solving the codeforces past contest or present one… and not focusing much on DSA…
Like learning proper DSA…
Will this harm me… Should i do both the thing parallelly.

Yes u should ,Learning DSA properly should be ur utmost priority .

Yaa… Thanks :slight_smile:

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.