IZhO 2014 - Bank

Author: Benjamin Qi

Time Complexity: O(M2M)\mathcal{O}(M2^M)

int N,M;
bitset<1<<20> dp;
int main() {
setIO(); re(N,M);
vi a(N), b(M); re(a,b);
vi cum{0}; trav(t,a) cum.pb(cum.bk+t);
dp[0] = 1;
F0R(i,1<<M) if (dp[i]) {
int sum = 0;

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!