func_code_string: #include <bits/stdc++.h>   using namespace std;   const int mx = 2e5 + 5;   int dp[mx][3], arr[mx], n, h[mx];   void solve() {     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> arr[i];       h[arr[i]]++;     }     sort(arr, arr + n + 1);     memset(dp, 0, sizeof dp);     dp[1][0] = dp[1][1] = dp[1][2] = 1;     for (int i = 2; i <= n; i++) {       if (arr[i] - arr[i - 1] > 2) {         dp[i][1] = dp[i][2] = dp[i][0] =             min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;       } else if (arr[i] - arr[i - 1] == 2) {         dp[i][0] = min(dp[i - 1][0] + 1, min(dp[i - 1][1] + 1, dp[i - 1][2]));         dp[i][1] = dp[i][2] =             min(dp[i - 1][0], min(dp[i - 1][1], dp[i - 1][2])) + 1;       } else if (arr[i] - arr[i - 1] == 1) {         dp[i][0] = min(dp[i - 1][0] + 1, min(dp[i - 1][1], dp[i - 1][2] + 1));         dp[i][1] = min(dp[i - 1][0] + 1, min(dp[i - 1][1] + 1, dp[i - 1][2]));         dp[i][2] = min(dp[i - 1][0] + 1, min(dp[i - 1][1] + 1, dp[i - 1][2] + 1));       } else {         dp[i][0] = min(dp[i - 1][0], min(dp[i - 1][1] + 1, dp[i - 1][2] + 1));         dp[i][1] = min(dp[i - 1][0] + 1, min(dp[i - 1][1], dp[i - 1][2] + 1));         dp[i][2] = min(dp[i - 1][0] + 1, min(dp[i - 1][1] + 1, dp[i - 1][2]));       }     }     cout << min(dp[n][0], min(dp[n][1], dp[n][2])) <<    ;     set<int> s;     for (int i = 0; i < mx; i++) {       if (h[i] > 0) {         int t = min(3, h[i]);         int x = i - 1;         if (s.find(x) == s.end()) {           s.insert(x);           h[i]--;         }         x++;         if (h[i] > 0) {           if (s.find(x) == s.end()) {             s.insert(x);             h[i]--;           }         }         x++;         if (h[i] > 0) {           if (s.find(x) == s.end()) {             s.insert(x);             h[i]--;           }         }       }     }     cout << s.size();   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(NULL);     cout.tie(NULL);     ;     int t = 1;     while (t--) {       solve();     }   }   