Problem 146 Color Cubes

Back to Problem Solutions forum

ABenedict     2021-06-13 20:23:13

Hi everyone.

I ask for help. On the test data with the help of my code, I persistently get the answer 46 although the correct 54. I tried to redo it with a sheet of paper and a pencil. I also received the answer 46 ... Probably somewhere I am making a mistake. I can't figure out exactly where. If necessary, I can place the code in Python.

Thank you in advance.

Rodion (admin)     2021-06-14 07:40:57
User avatar

I can place the code in Python.

that's not needed, it is accessible in your profile in unsuccessful - right?

I have tried to write down the step-by-step explanation for the given example in the end of problem statement - so please have a look at it and see whether it clarifies the matter (or contains an error?). I'd say manipulations are a bit confusing - and I myself failed several times :)

ABenedict     2021-06-14 16:59:31

Rodion, thank a lot. I think this will help me. I'll lern for this problem. I'll write to you on the result.

The code in my profile is still very rough. I'm sory if this is inconvenient. I'll fix it)))

ABenedict     2021-06-22 17:15:22

Good day, Rodion.

Finally, I was able to deal with this problem. My mistake was that I thought that cells should be removed if their number is 2 or more. What I missed is that even a single cell counts for a player and points. I fixed this in my code.

Thank you for your help. You have described the test data solution step by step. It helped to see my error almost immediately.

qwerty     2021-06-22 18:14:58

Hello, Benedict! Nice to hear that you succeeded!

Yeah, it it important to correctly understand the problem. I had many troubles because of misunderstanding, too.

ABenedict     2021-06-22 19:28:53

Hello qwerty_one. You're absolutely right. I need to carefully understand the condition of the problem. I've been messing around with this problem for a long time. But I wrote a visualization for it))). It feels good when a problem is solved))) Thanks for your feedback.

Please login and solve 5 problems to be able to post at forum