func_code_string: #include <bits/stdc++.h>   const int maxx = 2e6 + 5;   using namespace std;   long long a[maxx];   long long biaoji[maxx] = {0};   int main() {     long long t, i, j, m, n;     cin >> n;     long long maxl = 0;     for (i = 1; i <= n; i++) {       scanf( %lld , &a[i]);       maxl = max(maxl, a[i]);       biaoji[a[i]]++;     }     long long sum1 = 0, sum2 = 0;     long long cishu = 0;     long long weizhi = 0;     for (i = 1; i <= maxl + 1; i++) {       if (biaoji[i] > 0) {         if (biaoji[i + 1] > 0 && biaoji[i + 2] > 0) {           sum1++;           i += 2;         } else if (biaoji[i + 1] > 0) {           sum1++;           i++;         } else if (biaoji[i + 2] > 0) {           sum1++;           i += 2;         } else {           sum1++;           i += 2;         }       }     }     for (i = 0; i <= maxl + 1; i++) {       if (i >= 1 && biaoji[i - 1] >= 1) {         sum2++;       } else if (biaoji[i] == 0) {         if (biaoji[i + 1] >= 1) {           biaoji[i + 1]--;           sum2++;         }       } else if (biaoji[i] >= 1) {         biaoji[i]--;         sum2++;       }     }     printf( %lld %lld n , sum1, sum2);     return 0;   }   