func_code_string: #include <bits/stdc++.h>   using namespace std;   const int inf = 0x3f3f3f3f;   const int N = 1050;   const long long mod = 1e9 + 7;   int l, r, n, id = 1;   int a[N];   bool vis[N];   char ans[N][N];   void work(int now, int i) {     bool flag = true;     while (!vis[i]) {       vis[i] = 1;       if (flag) {         if (a[i] > i)           ans[id][i] = ans[id][a[i]] =  / ;         else {           ans[id][i] = ans[id][r] =  / ;           ++id;           ans[id][r] = ans[id][a[i]] =     ;           flag = 0;         }       } else {         if (a[i] < i)           ans[id][i] = ans[id][a[i]] =     ;         else {           ans[id][i] = ans[id][now] =     ;           ++id;           ans[id][now] = ans[id][a[i]] =  / ;           flag = 1;         }       }       i = a[i];     }   }   int main() {     cin >> n;     l = inf, r = 0;     for (int i = 1; i <= n; ++i) scanf( %d , &a[i]);     for (int i = 1; i <= n; ++i) {       if (a[i] != i) l = min(l, i), r = max(r, i);     }     if (l == inf) {       printf( %d n , n);       for (int i = 1; i <= n; ++i, puts(  ))         for (int j = 1; j <= n; ++j) printf( . );       return 0;     }     int pre = 1, nxt = a[r];     for (int i = 1; i <= n; ++i)       for (int j = 1; j <= n; ++j) ans[i][j] =  . ;     for (int i = l; i <= r; ++i)       if (a[i] == r) pre = i;     a[pre] = a[r];     a[r] = r;     for (int i = l; i < r; ++i) {       if (a[i] == i || vis[i]) continue;       work(i, i);       id++;     }     ans[id][nxt] = ans[id][r] =  / ;     cout << n - 1 << endl;     for (int i = n; i >= 1; --i) {       printf( %s n , ans[i] + 1);     }     return 0;   }   