func_code_string: #include <bits/stdc++.h>   using namespace std;   pair<int, int> a[100005];   int sum = 0, m;   char s[10005][105];   void f(int target, int n) {     int i, j, k, l;     m = max((a[n].first - target), ((sum - n * target) / 2));     for (i = 0; i < m; i++) {       for (j = 0; j < n; j++) s[i][j] =  0 ;       s[i][j] =   0 ;     }     int total = sum - n * target;     for (i = n, j = 0, k = 0, l = 1; l <= total || k < 2;) {       s[j][a[i].second - 1] =  1 ;       a[i].first--;       if (a[i].first <= target && i > 1) i--;       j++;       l++;       if (j >= m) {         j = 0;         k++;       }     }     return;   }   int main() {     int i, j, k, l, n;     scanf( %d , &n);     for (i = 1; i <= n; i++) {       int val;       scanf( %d , &val);       a[i] = make_pair(val, i);       sum += a[i].first;     }     sort(a + 1, a + n + 1);     for (i = a[1].first; i >= 1; i--) {       if ((sum - n * i) / 2 >= (a[n].first - i)) break;     }     f(i, n);     cout << i << endl << m << endl;     for (i = 0; i < m; i++) printf( %s n , s[i]);     return 0;   }   