SHARE
TWEET

SOS DP

sacgajcvs Dec 6th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for(int i = 0; i<(1<<N); ++i)
  2.     F[i] = A[i];
  3. for(int i = 0;i < N; ++i) for(int mask = 0; mask < (1<<N); ++mask){
  4.     if(mask & (1<<i))
  5.         F[mask] += F[mask^(1<<i)];
  6. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top