malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   vector<int> vec;   int result[50000];   int MIN(int i, int j) {     int ans = 1e9;     for (int a = i; a <= j; a++) {       ans = min(ans, vec[a]);     }     return ans;   }   int main() {     int n, m;     scanf( %d %d , &n, &m);     for (int i = 0; i < (n); i++) vec.push_back(i + 1);     int limit = 1;     for (int i = 0; i < (n); i++) limit *= (i + 1);     int sum, mx = 0, realsum = 0;     for (int z = 0; z < (limit); z++) {       for (int i = 0; i < (n); i++) {         sum = 0;         for (int j = i; j < n; j++) sum += MIN(i, j);         ;         realsum += sum;       }       if (realsum > mx) mx = realsum;       result[z] = realsum;       realsum = 0;       next_permutation(vec.begin(), vec.end());     }     vector<int> sol;     for (int i = 0; i < (n); i++) sol.push_back(i + 1);     int cnt = 0;     for (int z = 0; z < (limit); z++) {       if (result[z] == mx) {         cnt++;         if (cnt == m) {           printf( %d , sol[0]);           for (int i = 1; i < n; i++) printf(  %d , sol[i]);           printf(  n );           break;         }       }       next_permutation(sol.begin(), sol.end());     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1000000007;   const int N = 1e5 + 9;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     ;     int x;     cin >> x;     long long ans = 0, c = 0;     int y[x];     for (int i = 0; i < x; i++) cin >> y[i];     for (int i = x - 1; i >= 0; i--) {       if (!y[i])         c++;       else         ans += c;     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string s[6];   vector<string> res;   void draw(vector<string> &w, int x, int y, int dx, int dy, string s) {     for (int k = 0; k < s.size(); k++, x += dx, y += dy) {       w[x][y] = s[k];     }     return;   }   int main() {     for (int i = 0; i < 6; i++) cin >> s[i];     sort(s, s + 6);     res.clear();     do {       if (s[0].size() + s[2].size() == s[1].size() + 1 &&           s[3].size() + s[5].size() == s[4].size() + 1) {         int l[6];         for (int i = 0; i < 6; i++) l[i] = s[i].size() - 1;         if (s[0][0] == s[3][0] && s[0][l[0]] == s[4][0] &&             s[1][0] == s[3][l[3]] && s[1][l[0]] == s[4][l[3]] &&             s[1][l[1]] == s[5][0] && s[2][0] == s[4][l[4]] &&             s[2][l[2]] == s[5][l[5]]) {           int n = l[4] + 1, m = l[1] + 1;           vector<string> w(n, string(m,  . ));           draw(w, 0, 0, 0, 1, s[0]);           draw(w, l[3], 0, 0, 1, s[1]);           draw(w, n - 1, l[0], 0, 1, s[2]);           draw(w, 0, 0, 1, 0, s[3]);           draw(w, 0, l[0], 1, 0, s[4]);           draw(w, l[3], l[1], 1, 0, s[5]);           if (res.size() == 0 || res > w) res = w;         }       }     } while (next_permutation(s, s + 6));     if (res.size() == 0) cout <<  Impossible  << endl;     for (int i = 0; i < res.size(); i++) cout << res[i] << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int MX = 102, md = 1000000007;   int n, k, i, j, e, c[MX][MX], f[MX][MX * MX];   long long m, p[MX], q[MX];   bool ifq;   long long pw(long long a, long long b) {     if (b == 0) return 1LL;     if (b & 1) return (a * pw(a, b - 1)) % md;     long long x = pw(a, b / 2);     return (x * x) % md;   }   int main() {     cin >> n >> m >> k;     for (i = 0; i <= n; i++) {       c[i][0] = 1;       for (j = 1; j <= i; j++) c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % md;     }     for (i = 0; i <= n; i++) {       p[i] = pw(c[n][i], m / n);       q[i] = (p[i] * c[n][i]) % md;     }     f[0][0] = 1;     for (i = 0; i < n; i++) {       ifq = (i < (m % n));       for (j = 0; j <= k; j++)         if (f[i][j])           for (e = 0; e <= n && j + e <= k; e++)             f[i + 1][j + e] =                 (f[i + 1][j + e] + f[i][j] * (ifq ? q[e] : p[e])) % md;     }     cout << f[n][k] <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 0x3f3f3f3f;   const long long INFF = 0x3f3f3f3f3f3f3f3f;   const double pi = acos(-1.0);   const double eps = 1e-9;   const long long mod = 1e9 + 7;   int read() {     int x = 0, f = 1;     char ch = getchar();     while (ch< 0  | ch>  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       x = x * 10 + ch -  0 ;       ch = getchar();     }     return x * f;   }   void Out(int aa) {     if (aa > 9) Out(aa / 10);     putchar(aa % 10 +  0 );   }   int x[505], y[505];   int dp[1010][1010];   int n, m, k;   bool check(int t) {     vector<int> X, Y;     X.push_back(1), X.push_back(n + 1);     Y.push_back(1), Y.push_back(m + 1);     for (int i = 1; i <= k; i++) {       X.push_back(max(x[i] - t, 1)), X.push_back(min(n + 1, x[i] + t + 1));       Y.push_back(max(1, y[i] - t)), Y.push_back(min(m + 1, y[i] + t + 1));     }     sort(X.begin(), X.end());     X.erase(unique(X.begin(), X.end()), X.end());     sort(Y.begin(), Y.end());     Y.erase(unique(Y.begin(), Y.end()), Y.end());     memset(dp, 0, sizeof(dp));     for (int i = 1; i <= k; i++) {       int l1 = lower_bound(X.begin(), X.end(), max(x[i] - t, 1)) - X.begin();       int l2 =           lower_bound(X.begin(), X.end(), min(x[i] + t + 1, n + 1)) - X.begin();       int r1 = lower_bound(Y.begin(), Y.end(), max(y[i] - t, 1)) - Y.begin();       int r2 =           lower_bound(Y.begin(), Y.end(), min(y[i] + t + 1, m + 1)) - Y.begin();       dp[l1][r1]++, dp[l2][r2]++;       dp[l1][r2]--;       dp[l2][r1]--;     }     int l = n + 1, r = 0;     int u = m + 1, d = 0;     for (int i = 0; i < X.size() - 1; i++)       for (int j = 0; j < Y.size() - 1; j++) {         if (i && j)           dp[i][j] += -dp[i - 1][j - 1] + dp[i][j - 1] + dp[i - 1][j];         else if (i)           dp[i][j] += dp[i - 1][j];         else if (j)           dp[i][j] += dp[i][j - 1];         if (dp[i][j]) continue;         l = min(l, X[i]);         r = max(r, X[i + 1] - 1);         u = min(u, Y[j]);         d = max(d, Y[j + 1] - 1);       }     return max(r - l, d - u) <= 2 * t;   }   int main() {     n = read(), m = read(), k = read();     for (int i = 1; i <= k; i++) x[i] = read(), y[i] = read();     int l = 0, r = max(n, m);     int ans = r;     while (r >= l) {       int mid = (l + r) / 2;       if (check(mid))         ans = mid, r = mid - 1;       else         l = mid + 1;     }     Out(ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int tr[400], ar[400];   vector<pair<int, int> > vv;   int main() {     int n;     cin >> n;     for (int i = 0; i < n; i++) cin >> ar[i];     for (int i = 0; i < n; i++) cin >> tr[i];     for (int i = 0; i < n; i++) {       if (tr[i] == ar[i]) continue;       int j;       for (j = i + 1; j < n; j++)         if (tr[j] == ar[i]) break;       for (j = j - 1; j >= i; j--) {         int tmp = tr[j];         tr[j] = tr[j + 1];         tr[j + 1] = tmp;         vv.push_back(make_pair(j, j + 1));       }     }     if (vv.size() >= 1000000) return -1;     cout << vv.size() << endl;     for (int i = 0; i < vv.size(); i++) {       cout << vv[i].first + 1 <<     << vv[i].second + 1 << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long inf = 1e15 + 9;   const long long N = 1e5 + 5;   long long A[N], n, k, B[N];   map<long long, long long> mm;   void solve() {     long long i, j, x = 0, y = 1, m;     cin >> n;     for (i = 0; i < n; i++) {       cin >> x >> y;       mm[x] = max(mm[x], y);     }     cin >> m;     for (i = 0; i < m; i++) {       cin >> x >> y;       mm[x] = max(mm[x], y);     }     x = 0;     for (auto i : mm) x += i.second;     cout << x;   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long t = 1, i;     while (t--) {       solve();     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long int n;     cin >> n;     vector<long long int> v;     for (long long int i = 0; i < n; i++) {       long long int x;       cin >> x;       v.push_back(x);     }     long long int z;     long long int count = 1;     for (long long int i = 0;; i++) {       if (n == count) {         z = i;         break;       } else         count *= 4;     }     sort(v.begin(), v.end());     reverse(v.begin(), v.end());     long long int prev = 0;     long long int end = 1;     vector<long long int> ans;     while (prev < n) {       long long int sum = 0;       for (long long int j = prev; j < end; j++) sum += v[j];       ans.push_back(sum);       sum = 0;       prev = end;       end *= 4;     }     long long int fin = 0;     long long int calc = z + 1;     for (long long int j = 0; j < ans.size(); j++) {       fin += ans[j] * calc;       calc--;     }     cout << fin;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long gcd(long long a, long long b) {     while (b) {       a %= b;       swap(a, b);     }     return a;   }   long long lcm(const long long &a, const long long &b) {     return (a / gcd(a, b)) * b;   }   bool check(long long a) {     int k = 0;     while (a > 0) {       if (!(a & 1)) {         k++;       }       a >>= 1;     }     return k == 1;   }   int bits(long long a) {     int k = 0;     if (a == 0) {       return 1;     }     while (a > 0) {       k++;       a >>= 1;     }     return k;   }   int main() {     int h, w;     cin >> h >> w;     char c;     vector<vector<int>> a(h + 2, vector<int>(w + 2, 1));     for (int i = 1; i <= h; i++) {       for (int j = 1; j <= w; j++) {         cin >> c;         if (c ==  . ) {           a[i][j] = 0;         } else           a[i][j] = 1;       }     }     vector<vector<pair<int, int>>> v(h + 2, vector<pair<int, int>>(w + 2));     for (int i = 1; i <= h; i++) {       for (int j = 1; j <= w; j++) {         v[i][j].first = v[i][j - 1].first + (a[i][j - 1] + a[i][j] == 0 ? 1 : 0);       }     }     for (int j = 1; j <= w; j++) {       for (int i = 1; i <= h; i++) {         v[i][j].second =             v[i - 1][j].second + (a[i - 1][j] + a[i][j] == 0 ? 1 : 0);       }     }     int q;     cin >> q;     int l1, r1, l2, r2;     int ans = 0, s1, s2;     for (int i = 0; i < q; i++) {       cin >> l1 >> r1 >> l2 >> r2;       ans = 0;       s1 = 0;       s2 = 0;       for (int j = l1; j <= l2; j++) {         s1 = v[j][r2].first - v[j][r1].first;         ans += s1;       }       for (int j = r1; j <= r2; j++) {         s2 = v[l2][j].second - v[l1][j].second;         ans += s2;       }       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     int n, m;     cin >> n >> m;     vector<int> v[n + 1];     for (int i = 0; i < m; i++) {       int a, b;       cin >> a >> b;       v[a].push_back(b);     }     int cnt[n + 1];     for (int o = 1; o <= n; o++) {       for (int i = 0; i < (int)v[o].size(); i++) {         if (o < v[o][i])           v[o][i] -= o;         else           v[o][i] = n - (o - v[o][i]);       }       sort(v[o].begin(), v[o].end());       if (!v[o].empty())         cnt[o] = ((v[o].size() - 1) * n + v[o][0]);       else         cnt[o] = 0;     }     for (int o = 1; o <= n; o++) {       int res = cnt[o];       int mv = 0;       for (int i = o + 1;; i++) {         mv++;         if (i == n + 1) i = 1;         if (i == o) break;         res = max(res, (cnt[i] != 0) * (cnt[i] + mv));       }       cout << res <<    ;     }     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 5e4 + 10;   int b[MAXN], n, a[MAXN];   int ID(int x) {     x = x % n;     if (x < 0) x += n;     return x;   }   int main(void) {     scanf( %d , &n);     for (int i = 0; i < n; ++i) scanf( %d , a + i);     vector<pair<int, int> > foo;     for (int i = 0; i < n; ++i) foo.push_back(make_pair(a[i] + a[ID(i + 1)], i));     sort(foo.begin(), foo.end());     for (int i = 0; i < n; ++i) b[foo[i].second] = i;     printf( %d , b[0]);     for (int i = 1; i < n; ++i) printf(  %d , b[i]);     printf(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int ex[n], e[n];     int temp = n;     int i = 0;     while (temp--) {       cin >> ex[i] >> e[i];       i++;     }     int sum = e[0], m = e[0];     for (int j = 1; j < n; j++) {       sum = sum - ex[j] + e[j];       if (sum > m) {         m = sum;       }     }     cout << m << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 300050;   const int L = 19;   const long long inf = 1e15;   vector<int> E[N];   int par[N][L], dep[N];   void DFS(int u, int p) {     dep[u] = dep[p] + 1;     par[u][0] = p;     for (int i = 1; i < L; i++) par[u][i] = par[par[u][i - 1]][i - 1];     for (int v : E[u])       if (v != p) DFS(v, u);   }   int LCA(int u, int v) {     if (dep[u] < dep[v]) return LCA(v, u);     for (int i = L - 1; ~i; i--)       if (dep[par[u][i]] >= dep[v]) u = par[u][i];     for (int i = L - 1; ~i; i--)       if (par[u][i] != par[v][i]) u = par[u][i], v = par[v][i];     return u == v ? v : par[v][0];   }   vector<pair<int, int> > up[N];   bool ok[N];   long long dp[N];   int hi[N];   set<pair<long long, int> > st[N];   pair<long long, int> operator+(pair<long long, int> a, long long b) {     a.first += b;     return a;   }   long long st_add[N], ans;   void Solve(int u, int p) {     int nok = 0;     long long sum = 0;     hi[u] = dep[u];     for (int v : E[u])       if (v != p)         Solve(v, u), nok += !ok[v], sum += ok[v] ? dp[v] : 0,             hi[u] = min(hi[u], hi[v]);     if (nok) {       ok[u] = 0;     } else {       for (int v : E[u])         if (v != p) {           if (st[u].size() < st[v].size())             st[u].swap(st[v]), swap(st_add[u], st_add[v]);           for (auto p : st[v]) st[u].insert(p + (st_add[v] - st_add[u]));         }       dp[u] = sum;       for (auto p : up[u])         st[u].insert(make_pair(p.second, dep[p.first]) + (-st_add[u]));       if (hi[u] == dep[u]) {         while (st[u].size() && st[u].begin()->second >= dep[u])           st[u].erase(st[u].begin());         if (st[u].empty())           ok[u] = 0;         else {           ok[u] = 1;           dp[u] += st[u].begin()->first + st_add[u];           hi[u] = st[u].begin()->second;           st_add[u] -= st[u].begin()->first + st_add[u];           st[u].erase(st[u].begin());         }       } else         ok[u] = 1;     }     if (u == 1) ans = nok == 0 ? sum : -1;   }   int main() {     int n, m, i, u, v, c;     scanf( %i %i , &n, &m);     for (i = 1; i < n; i++)       scanf( %i %i , &u, &v), E[u].push_back(v), E[v].push_back(u);     DFS(1, 0);     for (i = 1; i <= m; i++)       scanf( %i %i %i , &u, &v, &c), up[u].push_back(make_pair(LCA(u, v), c));     Solve(1, 0);     printf( %lld n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long ans = 0;   string s;   int main() {     ios_base::sync_with_stdio(false);     cin >> s;     int id = -1;     for (int i = 0; i < (int)s.length(); i++) {       for (int j = 1; j <= 4 && i - 2 * j >= 0; j++)         if (s[i] == s[i - j] && s[i - j] == s[i - 2 * j]) id = max(id, i - 2 * j);       ans += id + 1;     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     char ch;     int state = 0;     while ((ch = cin.get()) != EOF) switch (state) {         case 0:           if (isdigit(ch)) {             cout << ch;             state = 1;           }           if (ch ==  , ) {             cout << ch;             state = 2;           }           if (ch ==    ) {             state = 0;           }           if (ch ==  . ) {             cout << ch;             state = 3;           }           break;         case 1:           if (isdigit(ch)) {             cout << ch;             state = 1;           }           if (ch ==  , ) {             cout << ch;             state = 2;           }           if (ch ==    ) {             state = 6;           }           if (ch ==  . ) {             cout <<    ;             cout << ch;             state = 3;           }           break;         case 2:           if (isdigit(ch)) {             cout <<    ;             cout << ch;             state = 1;           }           if (ch ==  , ) {             cout <<    ;             cout << ch;             state = 2;           }           if (ch ==    ) {             state = 2;           }           if (ch ==  . ) {             cout <<    ;             cout << ch;             state = 3;           }           break;         case 3:           if (ch ==  . ) {             cout << ch;             state = 4;           }           break;         case 4:           if (ch ==  . ) {             cout << ch;             state = 5;           }           break;         case 5:           if (isdigit(ch)) {             cout << ch;             state = 1;           }           if (ch ==  , ) {             cout << ch;             state = 2;           }           if (ch ==    ) {             state = 5;           }           if (ch ==  . ) {             cout <<    ;             cout << ch;             state = 3;           }           break;         case 6:           if (isdigit(ch)) {             cout <<    ;             cout << ch;             state = 1;           }           if (ch ==  , ) {             cout << ch;             state = 2;           }           if (ch ==    ) {             state = 6;           }           if (ch ==  . ) {             cout <<    ;             cout << ch;             state = 3;           }           break;       }   exit:     return (0);   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 1e9;   const int MN = 105;   bool mark[500][500];   char s[MN];   int dis[500][500];   int ask(pair<int, int> now) {     int res = INF;     if (mark[now.first][now.second]) res = min(res, dis[now.first][now.second]);     if (mark[now.first - 1][now.second])       res = min(res, dis[now.first - 1][now.second] + 1);     if (mark[now.first + 1][now.second])       res = min(res, dis[now.first + 1][now.second] + 1);     if (mark[now.first][now.second - 1])       res = min(res, dis[now.first][now.second - 1] + 1);     if (mark[now.first][now.second + 1])       res = min(res, dis[now.first][now.second + 1] + 1);     return res;   }   int main() {     scanf( %s , s);     int l = strlen(s);     pair<int, int> now = make_pair(105, 105);     mark[105][105] = 1;     dis[105][105] = 0;     int len = 0;     for (int i = 0; i < l; ++i) {       ++len;       if (s[i] ==  U ) now.second += 1;       if (s[i] ==  D ) now.second -= 1;       if (s[i] ==  L ) now.first -= 1;       if (s[i] ==  R ) now.first += 1;       if (ask(now) < len) {         printf( BUG n );         return 0;       }       mark[now.first][now.second] = 1;       dis[now.first][now.second] = len;     }     printf( OK n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 5e3 + 5;   const int inf = 1e9 + 7;   vector<pair<int, int> > adj[MAXN];   int dp[MAXN][MAXN], tr[MAXN][MAXN];   int n, m, t;   int solve(int u, int len) {     if (u == n and !len) return 0;     if (!len) return inf;     if (dp[u][len] != -1) return dp[u][len];     int ret = inf;     for (int i = 0; i < ((int)adj[u].size()); i++) {       int v = adj[u][i].first;       int c = adj[u][i].second;       long long x = solve(v, len - 1) + c;       if (x < ret) ret = x, tr[u][len] = v;     }     return dp[u][len] = ret;   }   void process() {     memset(dp, -1, sizeof(dp));     for (int i = 5000; i >= 0; i--) {       int ans = solve(1, i);       if (ans <= t) {         printf( %d n%d  , i + 1, 1);         int x = 1;         while (i--) {           x = tr[x][i + 1];           printf( %d  , x);         }       }     }   }   int main(void) {     scanf( %d%d%d , &n, &m, &t);     for (int u, v, c, i = 1; i <= m; i++) {       scanf( %d%d%d , &u, &v, &c);       adj[u].push_back(make_pair(v, c));     }     process();   }
#include <bits/stdc++.h>   using namespace std;   int main() {     unsigned long long N, x, y, input, r_code = 0;     cin >> N >> x >> y;     vector<unsigned long long> days;     for (unsigned long long i = 0; i < N; i++) {       cin >> input;       days.push_back(input);     }     unsigned long long temp1;     for (unsigned long long i = 0; i < N; i++) {       r_code = 0;       if (i < x) {         temp1 = 0;       } else         temp1 = x;       for (unsigned long long j = 1; j <= temp1; j++) {         if (days[i - j] <= days[i]) {           r_code = 1;           break;         }       }       if (r_code == 0) {         unsigned long long temp;         if (i + y >= N) {           temp = N - 1;         } else           temp = i + y;         for (unsigned long long j = i + 1; j <= temp; j++) {           if (days[j] <= days[i]) {             r_code = 1;             break;           }         }       }       if (r_code == 0) {         cout << (i + 1);         break;       }     }   }
#include <bits/stdc++.h>   using namespace std;   int lim = 1e6;   int inf = 1e8;   void err(istream_iterator<string> it) { cerr << endl; }   template <typename T, typename... Args>   void err(istream_iterator<string> it, T a, Args... args) {     cerr << *it <<   =   << a <<   t ;     err(++it, args...);   }   template <typename T1, typename T2>   ostream& operator<<(ostream& c, pair<T1, T2>& v) {     c <<  (  << v.first <<  ,  << v.second <<  ) ;     return c;   }   template <template <class...> class TT, class... T>   ostream& operator<<(ostream& out, TT<T...>& c) {     out <<  {  ;     for (auto& x : c) out << x <<    ;     out <<  } ;     return out;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       int ans = 0;       for (int i = 6; i >= 0; i--) {         int k = pow(2, i);         int j = 0;         vector<int> a, b;         for (int r = 1; r <= n; r++) {           if ((r / k) % 2 == 0) {             a.push_back(r);           } else {             b.push_back(r);           }         }         if (a.size() == 0 or b.size() == 0) continue;         cout << a.size() <<     << b.size() <<    ;         for (int j = 0; j < a.size(); j++) {           cout << a[j] <<    ;         }         for (int j = 0; j < b.size(); j++) {           cout << b[j] <<    ;         }         cout << endl;         int tmpans;         cin >> tmpans;         ans = max(ans, tmpans);       }       cout << -1 <<     << ans << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   void solve() {     string s;     cin >> s;     map<char, long long> mp;     for (long long i = 0; i < s.size(); i++) mp[s[i]]++;     long long c = 0;     for (auto it = mp.begin(); it != mp.end(); it++) {       if (it->second & 1) c++;     }     if (c <= 1)       cout <<  First ;     else {       if (c % 2 == 0)         cout <<  Second ;       else         cout <<  First ;     }   }   signed main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     solve();     return 0;   }