malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   long long mod = 998244353;   long long fast_exp(long long a, long long b) {     if (b <= 0)       return 1;     else {       long long res = 1;       res = fast_exp(a, b / 2);       res = (res * res) % mod;       if (b % 2 == 1) res = (res * a) % mod;       return res;     }   }   long long n, m, k;   long long dp[5001][5010] = {};   long long inv;   int main() {     cin >> n >> m >> k;     dp[0][0] = 1;     for (long long i = 0; i < k; i++) {       for (long long j = 0; j < 5001; j++) {         dp[i + 1][j] = (dp[i + 1][j] + (j)*dp[i][j]) % mod;         dp[i + 1][j + 1] = (dp[i + 1][j + 1] + (n - j) * dp[i][j]) % mod;       }     }     inv = fast_exp(m, mod - 2);     long long num = 0;     long long beg = fast_exp(m, n);     for (long long i = 0; i <= 5001; i++) {       num = (num + beg * dp[k][i]) % mod;       beg = (beg * inv) % mod;     }     long long denom = fast_exp(m, n);     denom = fast_exp(denom, mod - 2);     cout << (num * denom) % mod << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     int n;     cin >> n;     int *sher = new int[n];     char d;     for (int i = 0; i < n; i++) {       cin >> d;       sher[i] = d -  0 ;     }     int *mor = new int[n];     for (int i = 0; i < n; i++) {       cin >> d;       mor[i] = d -  0 ;     }     sort(sher, sher + n, greater<int>());     sort(mor, mor + n, greater<int>());     int out = 0;     int l = 0, r = n - 1;     for (int i = 0; i < n; i++) {       if (sher[i] > mor[l]) {         r--;         out++;       } else         l++;     }     cout << out << endl;     l = 0;     r = n - 1;     out = 0;     for (int i = 0; i < n; i++) {       if (sher[i] < mor[l]) {         l++;         out++;       } else         r--;     }     cout << out << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   int sz(const T &a) {     return (int)a.size();   }   const int MAXN = 2e5 + 1;   int arr[MAXN];   int fir[MAXN];   priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>>       q;   int main() {     cin.tie(NULL);     ios_base::sync_with_stdio(false);     int n;     cin >> n;     set<int> leaves;     for (int i = 1; i <= n; i++) leaves.insert(i), fir[i] = INT_MAX;     for (int i = 1; i < n; i++) {       cin >> arr[i];       fir[arr[i]] = min(fir[arr[i]], i);       leaves.erase(arr[i]);     }     vector<pair<int, int>> edges;     for (int x : leaves) {       q.push({x, x});     }     for (int i = n - 1; i >= 1; i--) {       auto cur = q.top();       q.pop();       edges.push_back({cur.second, arr[i]});       if (i == fir[arr[i]]) q.push({max(cur.first, arr[i]), arr[i]});     }     printf( %d n , arr[1]);     for (auto x : edges) printf( %d %d n , x.first, x.second);     return 0;   }
#include <bits/stdc++.h>   int main() {     int i, j, t, n, a[20000], counto, counte;     scanf( %d , &t);     for (i = 1; i <= t; i++) {       counto = 0, counte = 0;       scanf( %d , &n);       for (j = 0; j < n; j++) {         scanf( %d , &a[j]);         if (a[j] % 2 == 0)           counte++;         else           counto++;       }       if (counto == n && n % 2 == 0 || counte == n)         printf( NO );       else         printf( YES );       if (i != t) printf(  n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1000;   int fs[100], ft[100];   char c[1050], s[100], t[100];   int dp[1050][100][100];   void GetNextval(char* p, int next[]) {     int pLen = strlen(p);     next[0] = -1;     int k = -1;     int j = 0;     while (j < pLen) {       if (k == -1 || p[j] == p[k]) {         ++j;         ++k;         if (p[j] != p[k])           next[j] = k;         else           next[j] = next[k];       } else {         k = next[k];       }     }   }   int main() {     scanf( %s%s%s , c, s, t);     GetNextval(s, fs);     GetNextval(t, ft);     int nc = strlen(c);     int ns = strlen(s);     int nt = strlen(t);     for (int i = 0; i <= nc; i++)       for (int j = 0; j <= ns; j++)         for (int k = 0; k <= nt; k++) dp[i][j][k] = -1e9;     dp[0][0][0] = 0;     for (int i = 0; i <= nc; i++) {       for (char ch =  a ; ch <=  z ; ch++) {         if (c[i] !=  *  && ch != c[i]) continue;         for (int j = 0; j <= ns; j++) {           for (int k = 0; k <= nt; k++) {             if (dp[i][j][k] == -1e9) continue;             int jj = j;             int kk = k;             while (jj && ch != s[jj]) jj = fs[jj];             while (kk && ch != t[kk]) kk = ft[kk];             int f = 0;             if (s[jj] == ch) jj++;             if (t[kk] == ch) kk++;             if (jj == ns) f++;             if (kk == nt) f--;             dp[i + 1][jj][kk] = max(dp[i + 1][jj][kk], dp[i][j][k] + f);           }         }       }     }     int sum = -1e9;     for (int j = 0; j <= ns; j++)       for (int k = 0; k <= nt; k++) sum = max(sum, dp[nc][j][k]);     printf( %d n , sum);   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1e3 + 5;   struct node {     int l, r;   } num[MAXN];   int cmp(node x, node y) { return x.r < y.r; }   int main() {     int N;     vector<int> v;     v.clear();     scanf( %d , &N);     for (int i = 0; i < N; i++) {       scanf( %d%d , &num[i].l, &num[i].r);       if (num[i].r < num[i].l) {         int temp = num[i].l;         num[i].l = num[i].r;         num[i].r = temp;       }     }     sort(num, num + N, cmp);     v.push_back(num[0].r);     for (int i = 1; i < N; i++) {       if (num[i].l > v.back()) {         v.push_back(num[i].r);       }     }     printf( %d n , v.size());     for (int i = 0; i < v.size(); i++) printf( %d  , v[i]);     printf(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int x, i, p = 0, k = 0;     cin >> x;     char n[x + 1];     cin >> n;     for (i = 0; i < x; i++) {       if (n[i] ==  L )         p++;       else         k++;     }     cout << p + k + 1 << endl;   }
#include <bits/stdc++.h>   using namespace std;   int a[2000], b[2000];   inline bool valid(int i, int j, pair<int, int> pii) {     return i != pii.first && j != pii.second;   }   int main() {     int n, m;     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %d , &a[i]);     scanf( %d , &m);     for (int i = 0; i < m; i++) scanf( %d , &b[i]);     vector<pair<int, pair<int, int> > > v;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         int d = a[i] - b[j];         v.push_back(make_pair(d, make_pair(i, j)));       }     }     sort(v.begin(), v.end());     long long sa = 0, sb = 0;     for (int i = 0; i < n; i++) sa += a[i];     for (int i = 0; i < m; i++) sb += b[i];     long long minD = abs(sa - sb);     vector<pair<int, int> > pp;     int sz = v.size(), id;     if (sa - sb - 2LL * v[0].first <= 0)       id = 0;     else if (sa - sb - 2LL * v[sz - 1].first >= 0)       id = sz - 1;     else {       int lo = 0, hi = sz - 1;       while (hi - lo > 1) {         int mid = lo + (hi - lo) / 2;         if (sa - sb - 2LL * v[mid].first >= 0)           lo = mid;         else           hi = mid;       }       if (abs(sa - sb - 2LL * v[lo].first) < abs(sa - sb - 2LL * v[hi].first))         id = lo;       else         id = hi;     }     long long diff = abs(sa - sb - 2LL * v[id].first);     if (diff < minD) {       minD = diff;       pp.push_back(v[id].second);     }     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         long long sab = sa - sb - 2LL * (a[i] - b[j]);         if (sab - 2LL * v[0].first <= 0)           id = 0;         else if (sab - 2LL * v[sz - 1].first >= 0)           id = sz - 1;         else {           int lo = 0, hi = sz - 1;           while (hi - lo > 1) {             int mid = lo + (hi - lo) / 2;             if (sab - 2LL * v[mid].first >= 0)               lo = mid;             else               hi = mid;           }           if (abs(sab - 2LL * v[lo].first) < abs(sab - 2LL * v[hi].first))             id = lo;           else             id = hi;         }         for (int k = -20; k <= 20; k++) {           if (id + k >= 0 && id + k < sz) {             long long diff = abs(sab - 2LL * v[id + k].first);             if (diff < minD && valid(i, j, v[id + k].second)) {               minD = diff;               pp.clear();               pp.push_back(make_pair(i, j));               pp.push_back(v[id + k].second);             }           }         }       }     }     cout << minD << endl;     cout << pp.size() << endl;     for (int i = 0; i < pp.size(); i++)       cout << pp[i].first + 1 <<     << pp[i].second + 1 << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e5 + 5;   int sub_tree[maxn], n, T[maxn], P[maxn][22], L[maxn], par[maxn], ans[maxn], nn;   set<int> adj[maxn];   void lca_dfs(int u, int p) {     T[u] = p;     L[u] = (p > -1) ? L[p] + 1 : 0;     for (int s : adj[u]) {       if (s == p) continue;       lca_dfs(s, u);     }   }   void sub_dfs(int u, int p) {     nn++;     sub_tree[u] = 1;     for (int nd : adj[u]) {       if (nd == p) continue;       sub_dfs(nd, u);       sub_tree[u] += sub_tree[nd];     }   }   int getCentroid(int u, int p) {     for (int nd : adj[u]) {       if (nd == p) continue;       if (sub_tree[nd] > nn / 2) return getCentroid(nd, u);     }     return u;   }   void decompose(int u, int p) {     nn = 0;     sub_dfs(u, -1);     int centroid = getCentroid(u, -1);     par[centroid] = p;     for (int nd : adj[centroid]) {       adj[nd].erase(centroid);       if (nd == p) continue;       decompose(nd, centroid);     }     adj[centroid].clear();   }   void init_LCA(int n) {     memset(P, -1, sizeof(P));     L[1] = 0;     lca_dfs(1, -1);     for (int i = 1; i <= n; i++) {       P[i][0] = T[i];     }     for (int j = 1; (1 << j) < n; j++) {       for (int i = 1; i <= n; i++) {         if (P[i][j - 1] != -1) P[i][j] = P[P[i][j - 1]][j - 1];       }     }   }   int lca_query(int p, int q) {     int tmp, log, i;     if (L[p] < L[q]) tmp = p, p = q, q = tmp;     log = 1;     while (1) {       int next = log + 1;       if ((1 << next) > L[p]) break;       log++;     }     for (i = log; i >= 0; i--)       if (L[p] - (1 << i) >= L[q]) p = P[p][i];     if (p == q) return p;     for (i = log; i >= 0; i--)       if (P[p][i] != -1 && P[p][i] != P[q][i]) p = P[p][i], q = P[q][i];     return T[p];   }   int getDist(int p, int q) {     int lca = lca_query(p, q);     return L[p] + L[q] - 2 * L[lca];   }   void update(int x) {     int u = x;     while (u != -1) {       ans[u] = min(ans[u], getDist(u, x));       u = par[u];     }   }   void query(int x) {     int mini = 1e8;     int u = x;     while (u != -1) {       mini = min(mini, ans[u] + getDist(u, x));       u = par[u];     }     printf( %d n , mini);   }   int main() {     int a, b, m;     scanf( %d %d , &n, &m);     ;     for (int i = 0; i < n - 1; i++) {       scanf( %d %d , &a, &b);       ;       adj[a].insert(b);       adj[b].insert(a);     }     init_LCA(n);     decompose(1, -1);     for (int i = 1; i <= n; i++) ans[i] = 1e8;     update(1);     for (int i = 0; i < m; i++) {       scanf( %d %d , &a, &b);       ;       if (a == 2)         query(b);       else         update(b);     }   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 305;   int n, m;   inline int gi() {     char c = getchar();     while (c <  0  || c >  9 ) c = getchar();     int sum = 0;     while ( 0  <= c && c <=  9 ) sum = sum * 10 + c - 48, c = getchar();     return sum;   }   const int Maxn = 605, Maxm = Maxn * Maxn;   const long long Inf = 1ll << 60, zero = 5000000;   long long ans;   struct edge {     int to, next;     long long cap;   } e[Maxm];   int h[Maxn], tot, s, t;   inline void add(int u, int v, long long w) {     e[++tot] = (edge){v, h[u], w};     h[u] = tot;     e[++tot] = (edge){u, h[v], 0};     h[v] = tot;   }   bool vis[Maxn];   int l, r, que[Maxn], d[Maxn], cur[Maxn];   inline bool bfs() {     l = 0;     r = 1;     que[r] = s;     vis[s] = true;     do {       int u = que[++l];       for (int i = h[u], v; ~i; i = e[i].next)         if (e[i].cap && !vis[v = e[i].to]) {           vis[v] = true;           d[v] = d[u] + 1;           que[++r] = v;         }     } while (l < r);     return vis[t];   }   long long dfs(int u, long long a) {     if (u == t || a == 0) return a;     long long f, flow = 0;     for (int &i = cur[u], v; ~i; i = e[i].next) {       if (d[u] + 1 == d[v = e[i].to] && (f = dfs(v, min(a, e[i].cap)))) {         e[i].cap -= f;         e[i ^ 1].cap += f;         flow += f;         a -= f;         if (a == 0) break;       }     }     return flow;   }   int main() {     memset(h, -1, sizeof(h));     tot = -1;     n = gi();     s = n * 2 + 1;     t = s + 1;     for (int t, i = 1; i <= n; ++i) {       t = gi();       while (t--) add(i, gi() + n, Inf);     }     for (int i = 1; i <= n; ++i) add(i + n, t, zero);     for (int p, i = 1; i <= n; ++i) {       scanf( %d , &p);       add(s, i, zero - p);       ans -= zero - p;     }     while (bfs()) {       memset(vis, 0, sizeof(bool) * (t + 1));       memcpy(cur, h, sizeof(int) * (t + 1));       ans += dfs(s, Inf);     }     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   using namespace std;   const long double EPS = 1e-9;   const long double PI = acos(-1);   const long long INF = 1e18;   const long long mod = 1e9 + 7;   long long factorial(long long n) {     if (n == 0) return 1;     long long x = 1;     for (long long i = 1; i <= n; i++) {       x = (x * i) % mod;     }     return x;   }   long long power(long long x, long long y) {     long long res = 1;     x = x % mod;     while (y > 0) {       if (y & 1) res = (res * x) % mod;       x = (x * x) % mod;       y = y >> 1;     }     return res % mod;   }   long long modInverse(long long n) { return power(n, mod - 2); }   long long nCr(long long n, long long r) {     if (n < r) return 0;     if (r == 0) return 1;     return ((factorial(n) % mod) *             (modInverse(((factorial(r) % mod) * (factorial(n - r) % mod)) % mod) %              mod) %             mod);   }   long long xor_1_x(long long x) {     if (x % 4 == 0) return x;     if (x % 4 == 1) return 1;     if (x % 4 == 2) return x + 1;     return 0;   }   bool prime(long long n) {     if (n < 2) return false;     for (long long x = 2; x * x <= n; x++) {       if (n % x == 0) return false;     }     return true;   }   vector<long long> factors(long long n) {     vector<long long> f;     for (long x = 2; x * x <= n; x++) {       while (n % x == 0) {         f.push_back(x);         n /= x;       }     }     if (n > 1) f.push_back(n);     return f;   }   int dp[1000005], p[1000005], pf[1000005];   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     int test_cases = 1, tt = 1;     while (test_cases--) {       int n, mx = 0;       cin >> n;       memset(p, 0, sizeof(p)), memset(pf, 0, sizeof(pf));       int power[1000005];       memset(power, 0, sizeof(power));       for (int i = 0; i <= n - 1; i++) {         int a, b;         cin >> a >> b;         power[a] = b;         p[a] = 1;         mx = max(mx, a);       }       for (int i = 0; i <= mx; i++) {         pf[i] = (i - 1 >= 0 ? pf[i - 1] : 0) + p[i];       }       memset(dp, 0, sizeof(dp));       int ans = 1e7;       for (int i = 0; i <= mx; i++) {         if (p[i]) {           if (i - power[i] < 0)             dp[i] = pf[i] - 1;           else {             if (i - power[i] == 0) {               if (p[0] == 0)                 dp[i] = dp[i - power[i]] + pf[i] - pf[i - power[i]] - 1;               else                 dp[i] = dp[i - power[i]] + pf[i] - (pf[i - power[i]] - 1) - 1;             } else               dp[i] = dp[i - power[i] - 1] + pf[i] - pf[i - power[i] - 1] - 1;           }           ans = min(ans, dp[i] + pf[mx] - pf[i]);         } else {           dp[i] = (i - 1 >= 0 ? dp[i - 1] : 0);         }       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class A, class B>   ostream &operator<<(ostream &os, pair<A, B> p) {     return os <<  (  << p.first <<  ,   << p.second <<  ) ;   }   template <class A>   ostream &operator<<(ostream &os, vector<A> v) {     os <<  {  ;     for (auto &x : v) cout << x <<    ;     return os <<  } ;   }   template <class A>   ostream &operator<<(ostream &os, vector<vector<A>> v) {     os <<  {   << v.front() <<   n ;     for (auto it = next(v.begin()); it != v.end(); it++)       os <<      << *it <<   n ;     return os <<  } ;   }   using VI = vector<int>;   using VVI = vector<VI>;   using II = pair<int, int>;   using VII = vector<II>;   using L = long long;   using VL = vector<L>;   using VB = vector<bool>;   using VVB = vector<VB>;   VVI graph;   VII ans;   int T;   void dfs(int v = 0, int f = -1, int t = 0) {     ;     ans.emplace_back(v, t);     int faza = t + 1;     int time = int(graph[v].size());     bool cor = 0;     if (t >= time) {       cor = true;       ans.emplace_back(v, t - time);       faza = t - time + 1;     }     for (auto &u : graph[v]) {       if (u != f) {         dfs(u, v, faza);         ans.emplace_back(v, faza);         faza++;         if (faza > time and !cor) {           ans.emplace_back(v, 0);           faza = 1;         }       }     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     int n;     cin >> n;     graph.resize(n);     for (decltype((n - 1) - 1) i = (0), i__ = ((n - 1) - 1); i <= i__; i++) {       int u, v;       cin >> u >> v;       u--;       v--;       graph[u].emplace_back(v);       graph[v].emplace_back(u);     }     T = 1;     for (decltype((n)-1) i = (0), i__ = ((n)-1); i <= i__; i++)       T = max(T, int(graph[i].size()));     dfs();     ans.pop_back();     cout << int(ans.size()) <<   n ;     for (auto &p : ans) cout << p.first + 1 <<     << p.second <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1000010;   int n, x, tot = 0, Ans = 0, prime[maxn];   bool isprime[maxn];   map<int, int> sg, st;   void init() {     memset(isprime, true, sizeof(isprime));     isprime[1] = false;     for (int i = 2; i < maxn; i++) {       if (isprime[i]) prime[++tot] = i;       for (int j = 1; j <= tot && i * prime[j] < maxn; j++) {         isprime[i * prime[j]] = false;         if (i % prime[j] == 0) break;       }     }   }   void gao(int x) {     for (int i = 1; prime[i] * prime[i] <= x; i++) {       int t = 0;       while (x % prime[i] == 0) {         x /= prime[i];         t++;       }       if (t) st[prime[i]] |= 1 << (t - 1);     }     if (x != 1) st[x] |= 1;   }   int getsg(int x) {     if (x == 0) return 0;     if (sg.count(x)) return sg[x];     map<int, int> vis;     int p = x, t = 0;     while (p) p >>= 1, t++;     for (int i = 1; i <= t; i++) {       vis[getsg((x >> i) | (x & ((1 << i - 1) - 1)))] = 1;     }     for (int i = 0;; i++)       if (!vis[i]) return sg[x] = i;   }   int main() {     init();     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %d , &x), gao(x);     for (map<int, int>::iterator it = st.begin(); it != st.end(); it++)       Ans ^= getsg(it->second);     if (Ans)       puts( Mojtaba );     else       puts( Arpa );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       int n, m, k;       cin >> n >> m >> k;       int i = 0;       while (k--) {         int j = i;         for (int h = 0; h < m; h++) {           int x = h < n % m ? n / m + 1 : n / m;           cout << x;           while (x--) {             cout <<     << ++j;             j %= n;           }           if (h < n % m) i = j;           cout <<   n ;         }       }     }     return 0;   }
#include <bits/stdc++.h>   const int kN = 100000 + 5;   int n, parent[kN], type[kN];   std::vector<int> edges[2][kN];   int left[2][kN], right[2][kN], stmp;   int top[2][kN];   void dfs(int color, int u, int root) {     left[color][u] = ++stmp;     top[color][u] = root;     for (int v : edges[color][u]) {       dfs(color, v, root);     }     right[color][u] = stmp;   }   bool is_ancestor(int color, int u, int v) {     return top[color][u] == top[color][v] && left[color][u] <= left[color][v] &&            right[color][v] <= right[color][u];   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; ++i) {       scanf( %d%d , &parent[i], &type[i]);       if (parent[i] != -1) edges[type[i]][parent[i]].emplace_back(i);     }     for (int c = 0; c < 2; ++c) {       stmp = 0;       for (int i = 1; i <= n; ++i) {         if (left[c][i] == 0) {           dfs(c, i, i);         }       }     }     int q;     scanf( %d , &q);     while (q--) {       int tp, u, v;       scanf( %d%d%d , &tp, &u, &v);       if (u == v || top[0][u] == v) {         puts( NO );         continue;       }       bool flag = false;       if (tp == 1) {         flag = is_ancestor(0, u, v);       } else {         flag = type[v] == 1 &&                (is_ancestor(0, top[1][v], u) || is_ancestor(1, top[0][u], v));       }       puts(flag ?  YES  :  NO );     }   }
#include <bits/stdc++.h>   const int MaxN = 1 << 20;   using namespace std;   int dp[MaxN + 5];   char s[30][30];   int a[30][30], cost[30][30];   int bit[30][30];   int n, m;   int main() {     while (~scanf( %d%d , &n, &m)) {       for (int i = 0; i < n; i++) scanf( %s , s[i]);       for (int i = 0; i < n; i++)         for (int j = 0; j < m; j++) scanf( %d , &a[i][j]);       for (int i = 0; i < n; i++) {         for (int j = 0; j < m; j++) {           int Max = 0, tmp = 0;           bit[i][j] = 0;           for (int k = 0; k < n; k++) {             if (s[k][j] == s[i][j]) {               Max = max(Max, a[k][j]);               tmp += a[k][j];               bit[i][j] |= (1 << k);             }           }           cost[i][j] = tmp - Max;         }       }       for (int i = 0; i < (1 << n); i++) dp[i] = 1 << 29;       dp[0] = 0;       for (int i = 0; i < (1 << n); i++) {         for (int j = 0; j < n; j++) {           if ((i & (1 << j)) == 0) {             for (int k = 0; k < m; k++) {               dp[i | (1 << j)] = min(dp[i | (1 << j)], dp[i] + a[j][k]);               dp[i | bit[j][k]] = min(dp[i | bit[j][k]], dp[i] + cost[j][k]);             }           }         }       }       printf( %d n , dp[(1 << n) - 1]);     }     return 0;   }