Hello friends
Here is the link to my code http://www.codechef.com/viewsolution/5602196
I’ve tried almost all corner test cases and even the ones mentioned above but still my code gives a WA. Please tell me where am I going wrong.
My algorithm was to
find all subsets of the given sanskar intensities
filter out the subsets having sum = sum(sanskars)/K
find such K subsets and check if all the sanskars have been used.
My code is not passing for the last case only…for me it seems correct… point out the mistake please…
Link to code:CodeChef: Practical coding for everyone
Hey, I saw the editorial and understood the solution . But I used Greedy-Approach to solve the problem . Can anyone give me a testcase on which my solution is failing. (Try to avoid 0 based testcases as I am making some very obvious conceptual flaw.)And yaa its passing the above mentioned testcases.
I guess these are not corner cases, what I have done was : I have generated test cases using a script and checked your code with the accepted one. That’s all I did !!!, but you need to think(or try some random small cases using pen paper and check with them) if you didn’t have accepted code with you.