func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, nmax, nrpar, nrimpar, par, impar, i, sol;   int luat[200005];   struct el {     int val, poz;   } a[200005];   bool rearanjare(el x, el y) {     if (x.poz < y.poz)       return 1;     else       return 0;   }   bool comp(el x, el y) {     if (x.val < y.val)       return 1;     else       return 0;   }   int main() {     cin >> n >> nmax;     for (i = 1; i <= n; i++) {       cin >> a[i].val;       a[i].poz = i;       if (a[i].val % 2 == 0)         nrpar++;       else         nrimpar++;       if (a[i].val <= 200000) luat[a[i].val] = 1;     }     sort(a + 1, a + n + 1, comp);     impar = 1;     par = 2;     for (i = 1; i <= n; i++)       if (a[i].val == a[i + 1].val) {         if (nrpar > nrimpar) {           sol++;           if (a[i].val % 2 == 0) {             nrimpar++;             nrpar--;           }           while (luat[impar]) impar += 2;           a[i].val = impar;           luat[impar] = 1;           if (impar > nmax) sol = -1000000;         } else if (nrpar < nrimpar) {           sol++;           if (a[i].val % 2 == 1) {             nrimpar--;             nrpar++;           }           while (luat[par]) par += 2;           a[i].val = par;           luat[par] = 1;           if (par > nmax) sol = -1000000;         } else {           if (a[i].val % 2 == 1) {             sol++;             while (luat[impar]) impar += 2;             a[i].val = impar;             luat[impar] = 1;             if (impar > nmax) sol = -1000000;           } else {             sol++;             while (luat[par]) par += 2;             a[i].val = par;             luat[par] = 1;             if (par > nmax) sol = -1000000;           }         }       }     i = 0;     while (nrpar != nrimpar) {       i++;       if (a[i].val % 2 == 0 and nrpar > nrimpar) {         sol++;         nrimpar++;         nrpar--;         while (luat[impar]) impar += 2;         a[i].val = impar;         luat[impar] = 1;         if (impar > nmax) sol = -1000000;       } else if (a[i].val % 2 == 1 and nrpar < nrimpar) {         sol++;         nrimpar--;         nrpar++;         while (luat[par]) par += 2;         a[i].val = par;         luat[par] = 1;         if (par > nmax) sol = -1000000;       }     }     sort(a + 1, a + n + 1, rearanjare);     if (sol < 0) {       cout << -1;       return 0;     }     cout << sol <<   n ;     for (i = 1; i <= n; i++) cout << a[i].val <<    ;     return 0;   }   