WA in GIT01

,

I am trying to solve this question https://www.codechef.com/problems/GIT01
using python 3.5 My Interpreter on my system gives correct answer but the codechef interpreter results Wrong Answer
This is my solution https://www.codechef.com/viewsolution/16630482

Hi @digvijay9910,

Your code fails for the following test case:

4 5
GGGGG
GGGGG
GGGGG
GGGGG

Expected o/p: 30
Your code gives: 48

Hope this helps!

1 Like

I was not able to minimize the cost would be a great help if you could point me how to o that
Thanks already!!

Start the first cake being R and then G. Find the cost for both of them and the output would be min of them.

For example:
Let’s say,
n=4 ; m=5
So possible combinations are,
RGRGR
GRGRG
RGRGR
GRGRG

and,
GRGRG
RGRGR
GRGRG
RGRGR

So, for given input find the costs for both and print the min.
Hope this helps!

Thanks You are a good lad.

Glad it helped. @vijju123 @digvijay9910 Please close this thread. :slight_smile: