Created
July 31, 2018 00:47
-
-
Save Chillee/75426f90d9ddcd8dec8ea98dfe7a8d53 to your computer and use it in GitHub Desktop.
SOS DP (Sum over Subsets DP)
This file contains hidden or 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
| int F[1 << MAXBITS]; | |
| for (int i = 0; i <= MAXBITS; ++i) { | |
| for (int mask = 0; mask < (1 << MAXBITS); ++mask) { | |
| if (mask & (1 << i)) { | |
| F[mask] = max(F[mask], F[mask ^ (1 << i)]); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment