#include using namespace std; int main(){ int N; cin >> N; vector A(N); for (int i = 0; i < N; i++){ cin >> A[i]; } vector> dp(N + 1, vector(1 << 10, false)); dp[0][0] = true; for (int i = 0; i < N; i++){ for (int j = 0; j < (1 << 10); j++){ if (dp[i][j]){ dp[i + 1][(j + A[i]) % (1 << 10)] = true; dp[i + 1][j & A[i]] = true; } } } long long sum = 0; for (int i = 0; i < N; i++){ sum += A[i]; } vector used(sum + 1, false); used[sum] = true; int ans = 1; for (int i = 0; i < N; i++){ sum -= A[i]; for (int j = 0; j < (1 << 10); j++){ if (dp[i][j]){ int x = (j & A[i]) + sum; if (!used[x]){ used[x] = true; ans++; } } } cout << ans << endl; } }