I solved the problem MIKE3 which is giving me a correct answer for all random test cases i give to it but the OJ is giving me a WA for some reasons. here is my solution non documented version or documented version on pastebin In the solution which is documented enough for a good understanding i have reduced the problem to find the sets of the group(offers) which cant be dealt with together and used an array named graph to store this to find the solution. Help find the error in this algorithm/code ! asked 18 Mar '14, 15:31

Approach is try all possible combination 2^20. using DP answered 18 Mar '14, 15:33
no i don't want to change the approach , my algorithm looks mathematically sound to me but i want to know what went wrong
(18 Mar '14, 15:36)
What is your criteria to select a customer?
(18 Mar '14, 15:39)
1
Simply trying all possible combination is fine. DP is not necessary.
(18 Mar '14, 15:41)
Ya you may ignore DP part. just use recursion
(18 Mar '14, 15:44)
@randomizer I dont see any reason why you should downvote this answer. He was just trying to help. @jangwa retaliation is just as bad :D
(18 Mar '14, 16:02)
point taken @kcahdog
(18 Mar '14, 16:04)
Let people feel that codechef give equal right to every one. @kcahdog
(18 Mar '14, 16:07)
showing 5 of 7
show all

@randomizer I followed an approach similar to yours in making the m * m matrix denoting intersections but after that i used an exponential solution (of order O(m)*m ) to get the answer. here is link to my solution for reference right now. I will tell you what is wrong with your code in some time. answered 18 Mar '14, 15:43
thanks @kcahdog
(18 Mar '14, 15:49)
