Created
February 16, 2013 20:29
-
-
Save adilakhter/4968611 to your computer and use it in GitHub Desktop.
dynamic programming implementation for spoj/party
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Initialize OPT[0,c] = 0, for c = 0..C and OPT[i,0], for i= 0..n | |
For i = 1,...,n do | |
For c = 1,..,C do | |
Use above recurrence to compute OPT(i,c) | |
Return OPT(n,C) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment