Call it bad luck, weak test cases whatever, but you agree, that 5 is correct, right?
and this is an invalid test case too which doesnāt follow the last constraint
in C1 -> C2 -> C3
the cost is a + b
, in C1 - > C3
cost is b, how can a + b
be less than b
if a, b >= 0
?
@betlista no the correct answer is 6 because no repainting is required
P.S. you solution also returns 6
Sorry, my bad, Iāll do it betterā¦
Oh, my bad. Misunderstood the whole thing. Thanks, mate.
Iām not able to find the smaller one for now only for N = 50 and M = 25 with K = 625. Recently Iām not able to upload to pastebin, will let you know later today.
please please help me find a test case for which my solution doesnt work
http://www.codechef.com/viewsolution/3437870
@yagyank : Without coloring the grid, you can score a maximum of 4 not 6.
you must have made mistake in code : especially in this part B[i][j] - B[i][A[i]] - C[i][j] ā¦ But, if you code as B[i][j] - B[i][A[i]] - C[i][A[i]] => you will get 6 which is incorrect.
@zmmloser if you are talking about the case given by betlista then asnwer is 6. All the AC solutions also return 6! and i have coded like B[i][j]-B[i][A[i]]-C[i][j]ā¦not like the other way
Guys, take a look at my answer. I have seen that almost all programs given above fail in one or two test cases given by me.
thanks a lot ā¦i corrected one mistake in the code but it still shows wrong answer
http://www.codechef.com/viewsolution/3443912
hi please look at my solution, i am not able to identify where it is failingā¦tried several test cases and still got required answer
http://www.codechef.com/viewsolution/3371975
@rishabh1994 Your sorting method has some bug. I used built in sort method and got TLE. But after converting cin/cout to scanf/printf I could get it AC ā CodeChef: Practical coding for everyone
@rishabh1994 I changed your āpartitionā method to something that I know and got AC ā CodeChef: Practical coding for everyone
thank you so much for the help
@unavowed Yeah, you are right. Your solution is perfect, but it fails whenever there is at least one extra space or newline character. Fix your get_number() method and you will get AC ā CodeChef: Practical coding for everyone
read about knapsack 0-1. I think it will help
I know about 0-1 knapsack. But you canāt apply it here because of large constraints
hello all, shouldnāt the delta be like
delta[i]=max(B[i][j],B[i][A[j]]-C[i][j]). I didnāt get why is is
B[i][j] - B[i][A[i]]) - C[i][j]. Please help. Thanks