Problem in COLARR

What does this line signify in the problem “COLARR” in FEB14 Challenge…?
“However Chef can do at most K repaintings”.

I have tried to solve this problem but getting a WA.
One of my friend has solved it using exact k repaintings and he got accepted.

what does this mean?
Can someone please explain this?

Well since you had already been discussing things with your friend (kudos for that instead of searching the web for answers!!) I think that it might be clear to you now, no?

It simply means that when repainting the cells the chef can choose to repaint 0 (case where he doesnt change color of any cell), 1,2… up to K cells with a different color according to the problem statement…

Please experiment with more test cases to understand yourself.

This will be closed now!

@kuruma Could you solve this doubt if it doesn’t violate any policy : Can a single square be repainted multiple times? Something like paint square 1 to color 4 and than paint the same square from color 4 to 6.

@kcahdog, I haven’t solved the problem yet, but, from what I’ve read, I think it’s not a very likely scenario, i.e. it might be possible, but, it might not be the best option or might not lead to best possible answer…

@kuruma In certain cases it could depending on the costs. However it is not possible to discuss test cases here. I asked the admin for clarification but none was given! Will read it again and try a fresh approach later.

@kcahdog, One cell can be repainted only once!
Anything more than that would violate the spirit of the contest !

1 Like

@ashish1294 Thanks. I complicated it a lot more than should have