#include #include #define chmin(x,y) (x) = min((x),(y)) #define chmax(x,y) (x) = max((x),(y)) #define ld long double using namespace std; using namespace atcoder; using ll = long long; const ll mod = 998244353; using mint = modint998244353; using Graph = vector>; const vector dx = {1,0,-1,0}, dy = {0,1,0,-1}; int main(){ // input int N,K; cin >> N >> K; vector A(N); for(int i = 0; i < N; i++) cin >> A[i]; // solve ll ans = 0; stack> st; st.push({0,-1,0,0}); // v = {bit,cur,mod998, mod998244353} while(!st.empty()){ int bit = st.top()[0], cur = st.top()[1], mod998 = st.top()[2], mod353 = st.top()[3]; st.pop(); if(__builtin_popcount(bit) == K){ if(mod353 <= mod998) ans++; } else for(int nxt = cur + 1; nxt < N; nxt++){ st.push({bit+(1<