malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   vector<long long> g[100000 + 10];   map<pair<long long, long long>, long long> mp;   map<long long, pair<long long, long long> > road;   long long cnt[100000 + 10];   long long ans = 0;   int visited[100000 + 10];   int L[100000 + 100];   long long n;   void dfs(long long u) {     visited[u] = 1;     long long l = g[u].size();     cnt[u] = 1;     for (int i = 0; i < l; i++) {       long long v = g[u][i];       if (visited[v] == 0) {         L[v] = L[u] + 1;         visited[v] = 1;         dfs(v);         cnt[u] += cnt[v];         ans += mp[make_pair(u, v)] * cnt[v] * (n - cnt[v]);       }     }   }   int main() {     scanf( %lld , &(n));     for (int i = 1; i < n; i++) {       long long u, v, w;       scanf( %lld , &(u));       scanf( %lld , &(v));       scanf( %lld , &(w));       g[u].push_back(v);       g[v].push_back(u);       mp[make_pair(u, v)] = w;       mp[make_pair(v, u)] = w;       road[i] = make_pair(u, v);     }     L[1] = 1;     dfs(1);     int q;     scanf( %d , &(q));     while (q--) {       long long r;       long long w;       scanf( %lld , &(r));       scanf( %lld , &(w));       pair<long long, long long> x;       x = road[r];       if (L[x.first] > L[x.second]) {         long long tmp = x.first;         x.first = x.second;         x.second = tmp;       }       ans += (cnt[x.second]) * (n - cnt[x.second]) * (w - mp[x]);       mp[x] = w;       mp[make_pair(x.second, x.first)] = w;       double num = ans * 6.0 / (n * (n - 1));       printf( %.10f n , num);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct node {     int num;     long long x;   } tmp;   bool cmp(node a, node b) { return a.x > b.x; }   int main() {     ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);     int t;     vector<node> v;     cin >> t;     while (t--) {       v.clear();       long long n, w;       long long x;       cin >> n >> w;       for (int i = 1; i <= n; i++) {         cin >> x;         if (x > w)           continue;         else {           tmp.x = x;           tmp.num = i;           v.push_back(tmp);         }       }       if (v.empty()) {         cout <<  -1 n ;         continue;       }       sort(v.begin(), v.end(), cmp);       int flag = 0;       for (int i = 0; i < v.size(); i++) {         if (v[i].x >= w / 2 + w % 2) {           cout <<  1 n ;           cout << v[i].num <<   n ;           flag = 1;           break;         }       }       if (flag == 0) {         long long ssum = 0;         int k;         for (k = v.size() - 1; k >= 0; k--) {           ssum += v[k].x;           if (ssum >= w / 2 + w % 2) break;         }         if (k >= 0) {           cout << v.size() - k <<   n ;           for (int i = v.size() - 1; i >= k; i--) {             cout << v[i].num <<    ;           }           cout <<   n ;         } else           cout <<  -1 n ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     string s;     cin >> s;     bool neg = false;     for (int i = 1; i <= n / 4 && !neg; i++) {       for (int k = 0; k <= n - 1 - 4 * i; k++)         if (s[k] ==  *  && s[k + i] ==  *  && s[k + 2 * i] ==  *  &&             s[k + 3 * i] ==  *  && s[k + 4 * i] ==  * )           neg = true;     }     if (neg)       cout <<  yes ;     else       cout <<  no ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int N = 2e3 + 20;   const long long int mod = 998244353;   long long int dp[5050][5050];   bool mark[N * N + 10];   int32_t main() {     ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);     for (int i = 0; i <= 5000; ++i)       for (int j = 0; j <= 5000; j++) {         if (!i || !j)           dp[i][j] = 1;         else           dp[i][j] = (dp[i - 1][j] + j * dp[i - 1][j - 1]) % mod;       }     long long int a, b, c;     cin >> a >> b >> c;     return cout << (((dp[a][b] * dp[a][c]) % mod) * dp[b][c]) % mod, 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mxN = 1e5;   int n, l[17][17][mxN], r[17][17][mxN];   pair<int, int> qry(int i, int l2, int r2) {     int b = 31 - __builtin_clz(r2 - l2 + 1);     return {max(l[i][b][l2],                 l[i][b][(r2 - (1 << b) + 1) % n] - (r2 - (1 << b) + 1 - l2)),             max(r[i][b][(r2 - (1 << b) + 1) % n],                 r[i][b][l2] - (r2 - (1 << b) + 1 - l2))};   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> n;     if (n == 1) {       cout << 0;       return 0;     }     for (int i = 0; i < n; ++i) cin >> l[0][0][i], r[0][0][i] = l[0][0][i];     for (int i = 1; i < 17; ++i) {       int a = 1 << (i - 1);       for (int j = 0; j < n; ++j) {         l[0][i][j] = max(l[0][i - 1][j], l[0][i - 1][(j + a) % n] - a);         r[0][i][j] = max(r[0][i - 1][(j + a) % n], r[0][i - 1][j] - a);       }     }     for (int i = 1; i < 17; ++i) {       for (int j = 0; j < 17; ++j) {         int a = 1 << j;         for (int k = 0; k < n; ++k) {           int l2 = k - l[i - 1][j][k], r2 = k + a - 1 + r[i - 1][j][k];           if (r2 - l2 >= n - 1) {             l[i][j][k] = r[i][j][k] = n;             continue;           }           if (l2 < 0) {             l2 += n;             r2 += n;           }           tie(l[i][j][k], r[i][j][k]) = qry(i - 1, l2, r2);           l[i][j][k] += l[i - 1][j][k];           r[i][j][k] += r[i - 1][j][k];         }       }     }     for (int i = 0; i < n; ++i) {       int l2 = i, r2 = i, ans = 1, l3, r3;       for (int j = 16; j >= 0; --j) {         tie(l3, r3) = qry(j, l2, r2);         l3 = l2 - l3;         r3 += r2;         if (r3 - l3 < n - 1) {           ans += 1 << j;           l2 = l3;           r2 = r3;           if (l2 < 0) {             l2 += n;             r2 += n;           }         }       }       cout << ans <<    ;     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     scanf( %d , &n);     vector<int> h(n), res(n);     for (int i = 0; i < (int)(n); i++) {       scanf( %d , &h[i]);     }     int bad = 0;     int ans = 0;     for (int i = 0; i < (int)(n); i++) {       bad = min(bad, h[i] - i - 1);       res[i] = i + 1 + bad;     }     bad = n + 1;     for (int i = (int)(n)-1; i >= 0; i--) {       bad = min(bad, h[i] + i + 1);       res[i] = min(res[i], bad - i - 1);       ans = max(ans, res[i]);     }     printf( %d n , ans);   }
#include <bits/stdc++.h>   using namespace std;   vector<pair<int, int> > arr[111];   int vis[111], maxs;   void dfs(int now, int wei) {     if (vis[now]) return;     vis[now] = 1;     maxs = max(maxs, wei);     for (int e = 0; e < arr[now].size(); e++) {       int next = arr[now][e].first, n_wei = wei + arr[now][e].second;       if (vis[next]) continue;       dfs(next, n_wei);     }   }   int main(void) {     int n;     cin >> n;     for (int e = 0; e < n - 1; e++) {       int a, b, c;       cin >> a >> b >> c;       arr[a].push_back(make_pair(b, c));       arr[b].push_back(make_pair(a, c));     }     dfs(0, 0);     cout << maxs;   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC optimize( unroll-loops )   #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native )   using namespace std;   const long long N = 1 << 20 | 1, M = 998244353;   long long a[N], Ans[N], n, m, x, cnt[N], b[N], Q, wn[N], rev[N], w[N];   inline long long ksm(long long x, long long y) {     long long ans = 1;     for (; y; y >>= 1, x = x * x % M)       if (y & 1) ans = ans * x % M;     return ans;   }   inline void init(long long len) {     for (long long i = 1; i < len; i++)       rev[i] = rev[i >> 1] >> 1 | ((i & 1) * len / 2);   }   inline void reduce(long long &x) { x += x >> 31 & M; }   inline void ntt(long long y[], long long len, long long opt) {     for (long long i = 1; i < len; i++)       if (rev[i] > i) swap(y[i], y[rev[i]]);     for (long long h = 1; h < len; h <<= 1)       for (long long j = 0; j < len; j += h + h)         for (long long k = 0; k < h; ++k) {           const long long x = y[h + j + k] * w[h + k] % M;           reduce(y[h + j + k] = y[j + k] - x);           reduce(y[j + k] += x - M);         }     if (opt == -1) {       long long temp = ksm(len, M - 2);       for (long long i = 0; i < len; i++) y[i] = y[i] * temp % M;       reverse(y + 1, y + len);     }   }   inline void solve(long long l, long long r, long long a[]) {     if (l > r) {       a[0] = 1;       return;     }     if (l == r) {       a[0] = 1;       if (cnt[l] > 0) a[1] = 2;       if (cnt[l] > 1) a[2] = 1;       return;     }     long long len = 1;     while (len <= b[r] - b[l - 1]) len <<= 1;     long long mid = (l + r) / 2, b[len], c[len];     memset(b, 0, sizeof b);     memset(c, 0, sizeof c);     solve(l, mid, b);     solve(mid + 1, r, c);     init(len);     ntt(b, len, 1);     ntt(c, len, 1);     for (long long i = 0; i < len; i++) a[i] = b[i] * c[i] % M;     ntt(a, len, -1);   }   inline long long read() {     long long x = 0;     char c = 0;     for (; c <  0  || c >  9 ; c = getchar())       ;     for (; c >=  0  && c <=  9 ; c = getchar()) x = x * 10 + c - 48;     return x;   }   signed main() {     n = read();     m = read();     for (long long i = 1; i <= n; i++) cnt[read()]++;     ;     for (long long i = 1; i <= 300000; i++) b[i] = b[i - 1] + min(cnt[i], 2ll);     long long len = 1;     while (len <= 300000) len <<= 1;     for (long long mid = 1; mid < len; mid <<= 1) {       const long long wn = ksm(3, M / mid / 2);       w[mid] = 1;       for (long long i = 1; i < mid; ++i) w[i + mid] = w[i + mid - 1] * wn % M;     }     while (m--) {       scanf( %lld , &x);       memset(a, 0, sizeof a);       solve(1, x - 1, a);       for (long long i = 0; i <= 300000; i++) (Ans[i + x + 1] += a[i]) %= M;     }     Q = read();     while (Q--) {       x = read();       printf( %lld n , Ans[x / 2]);     }   }
#include <bits/stdc++.h>   using namespace std;   int n, m, hd[100010], x, y, cnt, sta[600010], tp, d[100010], la;   struct node {     int to, next, la, fro;   } e[600010];   void addedge(int x, int y) {     e[++cnt] = (node){y, hd[x], 0, x}, e[hd[x]].la = cnt, hd[x] = cnt;     e[++cnt] = (node){x, hd[y], 0, y}, e[hd[y]].la = cnt, hd[y] = cnt;     d[x]++, d[y]++;   }   int rev(int i) { return (i & 1) ? (i + 1) : (i - 1); }   void del(int x, int i) {     if (hd[x] == i)       hd[x] = e[i].next, e[hd[x]].la = 0;     else       e[e[i].next].la = e[i].la, e[e[i].la].next = e[i].next;   }   void work(int x) {     for (int i = hd[x]; i; i = hd[x]) {       del(x, i), del(e[i].to, rev(i));       work(e[i].to), sta[++tp] = i;     }   }   int main() {     scanf( %d%d , &n, &m), cnt = 0, memset(hd, 0, sizeof(hd)), la = 0;     for (int i = 1; i <= m; i++) scanf( %d%d , &x, &y), addedge(x, y);     for (int x = 1; x <= n; x++)       if (d[x] & 1) {         if (!la)           la = x;         else           addedge(la, x), la = 0;       }     for (int x = 1; x <= n; x++)       if ((d[x] >> 1) & 1) {         if (!la)           la = x;         else           la = 0;       }     if (la) addedge(la, la);     work(1), la = 0, printf( %d n , tp);     for (int i = tp; i; i--) {       if ((d[e[sta[i]].fro] >> 1) & 1) {         if (la)           d[la] += 2, d[e[sta[i]].fro] += 2, la = 0;         else           la = e[sta[i]].fro;       }       if (la)         printf( %d %d n , e[sta[i]].to, e[sta[i]].fro);       else         printf( %d %d n , e[sta[i]].fro, e[sta[i]].to);     }     return 0;   }
#include <bits/stdc++.h>   namespace FastIO {   bool IOerror = 0;   inline char nc() {     static char buf[100000], *p1 = buf + 100000, *pend = buf + 100000;     if (p1 == pend) {       p1 = buf;       pend = buf + fread(buf, 1, 100000, stdin);       if (pend == p1) {         IOerror = 1;         return -1;       }     }     return *p1++;   }   inline bool blank(char ch) {     return ch ==     || ch ==   n  || ch ==   r  || ch ==   t ;   }   template <class T>   inline bool read(T& x) {     bool sign = 0;     char ch = nc();     x = 0;     for (; blank(ch); ch = nc())       ;     if (IOerror) return false;     if (ch ==  - ) sign = 1, ch = nc();     for (; ch >=  0  && ch <=  9 ; ch = nc()) x = x * 10 + ch -  0 ;     if (sign) x = -x;     return true;   }   template <class T, class... U>   bool read(T& h, U&... t) {     return read(h) && read(t...);   }   };  // namespace FastIO   using namespace std;   using namespace FastIO;   mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());   const int INF = 0x3f3f3f3f;   const int mod = 998244353;   const int N = 2e5 + 10;   long long fac[N], invfac[N];   long long qpow(long long x, int n) {     long long res = 1;     while (n) {       if (n & 1) res = res * x % mod;       x = x * x % mod;       n /= 2;     }     return res;   }   void init() {     fac[0] = invfac[0] = 1;     for (int i = 1; i < N; i++) {       fac[i] = fac[i - 1] * i % mod;       invfac[i] = qpow(fac[i], mod - 2);     }   }   long long comb(int n, int m) {     if (m > n) return 0;     return fac[n] * invfac[m] % mod * invfac[n - m] % mod;   }   int main() {     long long n, k;     read(n, k);     long long ans = 0;     if (k < n) {       init();       k = n - k;       for (int i = 0; i <= k; i++)         ans = (ans + (i % 2 ? -1 : 1) * comb(k, i) * qpow(k - i, n) + mod) % mod;       if (n != k) ans = 2 * ans * comb(n, k) % mod;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct edge {     int y, next, id;   };   const int maxn = 100010, maxk = 20;   int n, m, num, head[maxn], depth[maxn], f[maxn][maxk], pre[maxn], ans[maxn],       s[maxn];   edge e[maxn << 1];   inline void add(int a, int b, int id) {     num++;     e[num].next = head[a];     head[a] = num;     e[num].y = b;     e[num].id = id;   }   void dfs(int k, int deep) {     depth[k] = deep;     for (int temp = head[k]; temp >= 0; temp = e[temp].next) {       int j = e[temp].y;       if (j != f[k][0]) {         pre[j] = e[temp].id;         f[j][0] = k;         int i = 0;         for (int i = 0; f[f[j][i]][i] > 0; i++) f[j][i + 1] = f[f[j][i]][i];         dfs(j, deep + 1);       }     }   }   inline int LCA(int a, int b) {     if (depth[a] < depth[b]) swap(a, b);     for (int i = 17; depth[a] > depth[b]; i--)       if (f[a][i] > 0 && depth[f[a][i]] >= depth[b]) a = f[a][i];     if (a == b) return a;     for (int i = 17; f[a][0] != f[b][0]; i--)       if (f[a][i] > 0 && f[a][i] != f[b][i]) {         a = f[a][i];         b = f[b][i];       }     return f[a][0];   }   void slove(int k) {     for (int temp = head[k]; temp >= 0; temp = e[temp].next) {       int j = e[temp].y;       if (j != f[k][0]) {         slove(j);         s[k] += s[j];       }     }     if (k > 1) ans[pre[k]] = s[k];   }   int main() {     scanf( %d , &n);     memset(head, -1, sizeof(head));     num = -1;     for (int i = 1; i < n; i++) {       int a, b;       scanf( %d%d , &a, &b);       add(a, b, i);       add(b, a, i);     }     memset(f, -1, sizeof(f));     dfs(1, 0);     scanf( %d , &m);     memset(ans, 0, sizeof(ans));     for (int i = 0; i < m; i++) {       int a, b;       scanf( %d%d , &a, &b);       int lca = LCA(a, b);       s[a]++;       s[b]++;       s[lca] -= 2;     }     slove(1);     for (int i = 1; i < n; i++) printf( %d  , ans[i]);     printf(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, ans, du[2010], d[2010], mx, sz, dp[2010];   int num, k, now, a[2010], dfn[2010], low[2010], st[2010], b[2010];   bool in[2010];   int cnt, head[2010], to[200010], nxt[200010];   vector<int> v[2010];   void add(int x, int y) {     cnt++;     to[cnt] = y;     nxt[cnt] = head[x];     head[x] = cnt;   }   void tarjan(int x, int fa) {     now++;     dfn[x] = low[x] = now;     st[k] = x;     k++;     in[x] = true;     for (int i = head[x]; i; i = nxt[i]) {       int y = to[i];       if (y == fa) {         continue;       }       if (!dfn[y]) {         tarjan(y, x);         low[x] = min(low[x], low[y]);       } else if (in[y]) {         low[x] = min(low[x], dfn[y]);       }     }     if (low[x] == dfn[x]) {       num++;       int y;       do {         y = st[k - 1];         a[y] = num;         in[y] = false;         k--;       } while (k > 0 && y != x);     }   }   void dfs(int x) {     dfn[x] = true;     for (int i = 0; i < v[x].size(); i++) {       int y = v[x][i];       if (dfn[y]) {         continue;       }       dfs(y);       if (du[y] > 1) {         mx = max(mx, dp[x] + dp[y] + 1);         dp[x] = max(dp[x], dp[y]);       }     }     if (du[x] <= 1) {       return;     }     sz++;     dp[x]++;     mx = max(mx, dp[x]);   }   void work(int x) {     if (du[x] > 1) {       dfs(x);       return;     }     for (int i = 0; i < v[x].size(); i++) {       int y = v[x][i];       if (du[y] > 1) {         dfs(y);         return;       }     }     dfs(x);   }   int main() {     scanf( %d%d , &n, &m);     for (int i = 0; i < m; i++) {       int x, y;       scanf( %d%d , &x, &y);       add(x, y);       add(y, x);     }     for (int i = 1; i <= n; i++) {       if (!dfn[i]) {         tarjan(i, 0);       }     }     for (int i = 1; i <= n; i++) {       for (int j = head[i]; j; j = nxt[j]) {         int y = to[j];         if (a[i] != a[y]) {           v[a[i]].push_back(a[y]);           du[a[i]]++;         }       }     }     ans = n - num;     memset(dfn, 0, sizeof(dfn));     for (int i = 1; i <= num; i++) {       if (!dfn[i]) {         ans++;         mx = sz = 0;         work(i);         ans += sz - mx;       }     }     ans--;     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline T sqr(T x) {     return x * x;   }   const double EPS = 1e-6;   const int INF = 0x3fffffff;   const long long LINF = INF * 1ll * INF;   const double PI = acos(-1.0);   using namespace std;   struct PointSet {     char val;     int num;   } ps[1000005];   char s[1000005];   int len;   void unionPoint() {     int cnt = 0;     for (int i = 1; i <= len; i++) {       if (ps[i].num > 0) {         if (ps[i].val == ps[cnt].val)           ps[cnt].num += ps[i].num;         else           ps[++cnt] = ps[i];       }     }     len = cnt;   }   int main() {     scanf( %s , s + 1);     len = strlen(s + 1);     ps[0] = { # , 0};     for (int i = 1; i <= len; i++) {       ps[i].val = s[i];       ps[i].num = 1;     }     unionPoint();     int ans = 0;     while (len > 1) {       ans++;       for (int i = 1; i <= len; i++) {         if (i == 1 || i == len)           ps[i].num--;         else           ps[i].num -= 2;       }       unionPoint();     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   bool visit[201];   int main() {     int n, k, a[201], i;     scanf( %d%d , &n, &k);     for (i = 0; i < n * 2 + 1; i++) scanf( %d , &a[i]);     for (i = 0; i < n && k; i++)       if (a[i * 2 + 1] > a[i * 2] + 1 && a[i * 2 + 1] > a[i * 2 + 2] + 1) {         a[i * 2 + 1]--;         k--;       }     for (i = 0; i < n * 2 + 1; i++) printf( %d  , a[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct jdb {     int x, y;     friend long long operator^(const jdb &a, const jdb &b) {       return 1ll * a.x * b.y - 1ll * a.y * b.x;     }     friend long long operator*(const jdb &a, const jdb &b) {       return 1ll * a.x * b.x + 1ll * a.y * b.y;     }     friend bool operator<(const jdb &a, const jdb &b) {       return (a.x != b.x ? a.x < b.x : a.y < b.y);     }     friend jdb operator-(const jdb &a, const jdb &b) {       return (jdb){a.x - b.x, a.y - b.y};     }   } p[300005], st[300005];   struct que {     int x, y;     long long ans;     que() { ans = -(1ll << 62); };   } q[300005];   vector<jdb> vec[300005 * 4];   int L[300005], pos[300005];   bool fl[300005], isq[300005];   int n, m, tot, top, cnt;   void insert(int k, int l, int r, int x, int y, int v) {     if (l == x && r == y) {       vec[k].push_back(p[v]);       return;     }     int mid = (l + r) / 2;     if (y <= mid)       insert(k * 2, l, mid, x, y, v);     else if (x > mid)       insert(k * 2 + 1, mid + 1, r, x, y, v);     else       insert(k * 2, l, mid, x, mid, v),           insert(k * 2 + 1, mid + 1, r, mid + 1, y, v);   }   void query(int i) {     if (!top) return;     jdb tmp = (jdb){q[i].x, q[i].y};     int l = 1, r = top;     while (r - l >= 3) {       int m1 = l + (r - l) / 3;       int m2 = r - (r - l) / 3;       if (tmp * st[m1] > tmp * st[m2])         r = m2;       else         l = m1;     }     for (int j = l; j <= r; j++) q[i].ans = max(q[i].ans, tmp * st[j]);   }   void solve(int k, int l, int r) {     long long mid = (l + r) / 2;     if (l < r) {       solve(k * 2, l, mid);       solve(k * 2 + 1, mid + 1, r);     }     top = 0;     sort(vec[k].begin(), vec[k].end());     for (int i = 0; i < vec[k].size(); i++) {       for (; top > 1 && ((vec[k][i] - st[top]) ^ (st[top] - st[top - 1])) <= 0;            top--)         ;       st[++top] = vec[k][i];     }     for (int i = l; i <= r; i++)       if (isq[i]) query(i);   }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       int tp, x, y;       scanf( %d , &tp);       if (tp == 1) {         scanf( %d%d , &x, &y);         p[++tot] = (jdb){x, y};         L[tot] = i;         pos[i] = tot;         cnt++;       }       if (tp == 2) {         scanf( %d , &x);         x = pos[x];         insert(1, 1, n, L[x], i, x);         L[x] = 0;         cnt--;       }       if (tp == 3) {         scanf( %d , &q[i].x);         q[i].y = 1;         isq[i] = 1;         if (!cnt) {           fl[i] = 1;           q[i].x = q[i].y = isq[i] = 0;         }       }     }     for (int i = 1; i <= tot; i++)       if (L[i]) insert(1, 1, n, L[i], n, i);     solve(1, 1, n);     for (int i = 1; i <= n; i++) {       if (fl[i]) puts( EMPTY SET );       if (isq[i]) printf( %I64d n , q[i].ans);     }   }