func_code_string: #include <bits/stdc++.h>   using namespace std;   template <typename F, typename S>   ostream &operator<<(ostream &os, const pair<F, S> &p) {     return os <<  (  << p.first <<  ,   << p.second <<  ) ;   }   template <typename T>   ostream &operator<<(ostream &os, const vector<T> &v) {     os <<  { ;     typename vector<T>::const_iterator it;     for (it = v.begin(); it != v.end(); it++) {       if (it != v.begin()) os <<  ,  ;       os << *it;     }     return os <<  } ;   }   template <typename T>   ostream &operator<<(ostream &os, const set<T> &v) {     os <<  [ ;     typename set<T>::const_iterator it;     for (it = v.begin(); it != v.end(); it++) {       if (it != v.begin()) os <<  ,  ;       os << *it;     }     return os <<  ] ;   }   template <typename F, typename S>   ostream &operator<<(ostream &os, const map<F, S> &v) {     os <<  [ ;     typename map<F, S>::const_iterator it;     for (it = v.begin(); it != v.end(); it++) {       if (it != v.begin()) os <<  ,  ;       os << it->first <<   =   << it->second;     }     return os <<  ] ;   }   int dx[4] = {1, -1, 0, 0};   int dy[4] = {0, 0, 1, -1};   const long long N = 1e6 + 1, M = 1e5 + 5, mod = 1e9 + 7, MOD = 1e9 + 7,                   inf = 5e18, MAX = 2e5;   string alphabet =  abcdefghijklmnopqrstuvwxyz ,          capital =  ABCDEFGHIJKLMNOPQRSTUVWXYZ , dig =  0123456789 ;   vector<bool> taken(N, false);   vector<int> ar;   void solve(int tt) {     int n, i, h, j, k, m, a, b;     cin >> n;     int sm = 0;     for (int i = 1; i <= n; i++) {       cin >> a;       ar.push_back(a);       taken[a] = true;       sm += a - 1;     }     vector<int> ans;     int cnt = 0;     for (int i = 0; i < n; i++) {       int cur = ar[i];       if (!taken[N - cur])         ans.push_back(N - cur);       else         ++cnt;       taken[N - cur] = true;     }     for (int i = 1; i < N && cnt > 0; i++) {       if (taken[i]) continue;       int now = N - i;       if (!taken[now]) {         taken[i] = taken[now] = true;         ans.push_back(i);         ans.push_back(N - i);         cnt -= 2;       }     }     cout << ans.size() <<   n ;     for (auto z : ans) {       sm -= (N - z - 1);       cout << z <<    ;     }   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long i;     long long T = 1, K;     for (auto blockTime = make_pair(chrono::high_resolution_clock::now(), true);          blockTime.second;          fprintf(stderr,  %s: %d ms n ,  Exec Time :  ,                  (int)chrono::duration_cast<chrono::milliseconds>(                      chrono::high_resolution_clock::now() - blockTime.first)                      .count()),               fflush(stderr), blockTime.second = false) {       long long x = 1;       while (x <= T) {         solve(x);         x++;       }     }     return 0;   }   