#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for(ll i=0; i < (n); i++) #define rrep(i, n) for(ll i=(n)-1; i >=0; i--) #define ALL(v) v.begin(),v.end() #define rALL(v) v.rbegin(),v.rend() #define FOR(i, j, k) for(ll i=j;i llvec; typedef vector dvec; typedef pair P; typedef long double ld; struct edge{ll x, c;}; /************************************** ** A main function starts from here ** ***************************************/ int main(){ ll N; cin >> N; llvec A(N); ll s = 0; llvec S(N+1, 0); rep(i, N){ cin >> A[i]; S[i+1] =S[i] + A[i]; } vector dp1(N+1, llvec(1<<10, 0));// AND vector dp2(N+1, llvec(1<<10, 0));// plus dp1[0][0] = 1; set ss; rep(i, N){ set tmp; set next; rep(j, 1<<10){ if(dp1[i][j]==1){ dp1[i+1][j & A[i]] = 1; dp1[i+1][(j + A[i])%(1<<10)] = 1; tmp.insert(j + A[i]); if(j+A[i]>=(1<<10))next.insert(j + A[i]); tmp.insert(j & A[i]); } } for(auto iss: ss){ if(iss+A[i]>=(1<<10))next.insert(iss + A[i]); tmp.insert(iss+A[i]); } cout << tmp.size() << endl; ss = next; } return 0; }