I need some good problems on stars and bars variants if anybody knows some catalogue of problems please do share.
I was given the assignment problem related to finding chromatic number of the graph and i was able to write a solution at that time,but i realised from my friend that it is an NP hard problem and i used "BFS" to just implement so i think it should fail at some test case, so can anybody help me finding the test case to prove it wrong!!
/*Here is the code*/
can anybody who has seen the problem "pylons" explain briefly about the test case 2 solution,i read the analysis section but could not understand it so it would be really helpful if someone could explain it!! LINK FOR THE PROBLEM
I just started with segment tree based problems but thinking about a lot on this question i just need a small hint or something to actually have a drive in this problem,can anybody just give me a hint how to approach this problem,
This problem is bugging me for days now, Can anybody tell where i am going wrong, Here is my code
I am doing in O(N^3), which should pass the given test cases,
but still exceeds please do help!!!
The problem basically says given N amount of money which has to be given!! we need to find how much minimum coins we can give and the total value of those coins such that the extra amount given is minimum using n given denomination!!
1400 -> N 3 -> no of denominations 500 1000 2000
Output: 1500 2
My question is what are the overlapping subproblems here!!!
Submission 1 in this code my solution accepts if i inititiate dp with -1; Submission 2 in this code my solution exceeds if i inititiate with dp=0 what makes the difference between the 2? i know if d>n dp=0 but i have covered that solution already so what further cases it counts uselessly,please help!! Problem Source
Source of problem I mean how greedy approach using recursion worked in this problem. Because lets say if for a particular value more than one pegs accept that value, than choosing the first one would give the best result how it can happen i mean, if we choose the later peg than it may happen that more balls can be put into, some solutions have greedy approach accepted,Please guide over here!! Uva 10276.
can anybody explain the question in breif , i have tried reading the editorial but failed to understand,it would be helpful if someone just give me a slight idea what the question demands? here is the question link: http://codeforces.com/problemset/problem/217/A