Skip to content

Commit

Permalink
adds temporarily code for SOS dp
Browse files Browse the repository at this point in the history
  • Loading branch information
iagorrr committed Aug 23, 2024
1 parent c28a1ab commit aa6710d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions content/Dynamic Programming/SOS.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const int LOG = 17;
int dp[(1<< LOG)];
for(int b = 0; b < LOG; b++){
for(int mask = 0; mask < (1<< LOG); mask++){
if(mask & (1<< b)){
dp[mask] |= dp[mask ^ (1LL << b)];
}
}
}

0 comments on commit aa6710d

Please sign in to comment.