### NeutralMilkHotel's blog

By NeutralMilkHotel, history, 11 months ago,

https://codeforces.com/contest/1366/submission/83422255 In today's contest i was trying to solve a problem and i got re. Can anyone explain why?

• 0

 » 11 months ago, # | ← Rev. 3 →   +5 It is really obvious from your memory consumption. It is a stack overflow. Imagine how many recursive calls you will do? Don't you think it is too much? I will give you a hint: HintImagine a stick is $X$ and a diamond is $Y$. You will need to minimize the sum of $X$ and $Y$ after you simultaneous subtract them. There are two methods of subtraction which will give you an emerald:$X=X-1$,$Y=Y-2$or$X=X-2$,$Y=Y-1$
•  » » 11 months ago, # ^ |   +3 thanks
•  » » » 11 months ago, # ^ |   0 You're welcome!