#include #include #include using namespace std; int main(){ int n, k, buff, p=0, seqSum = 0; cin >> n >> k; vector arr; for(int i =0; i < n; i++){ cin >> buff; arr.push_back(buff); } for(int i=1; i <= n; i++){ for (int j = 0; j <= n - i; j++) { seqSum = 0; for (int l = j; l < i + j; l++) { seqSum = seqSum | arr[l]; } if (seqSum == k) p++; } } cout << p; }