func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 53;   const int maxm = 23;   int n, m;   char s[maxn][maxm];   double dp[1 << 20];   long long f[1 << 20];   int main() {     scanf( %d , &n);     for (int i = 0; i < n; i++) scanf( %s , s[i]);     m = strlen(s[1]);     memset(f, 0, sizeof(f));     for (int i = 0; i < n; i++) {       for (int j = i + 1; j < n; j++) {         int same = 0;         for (int k = 0; k < m; k++) {           if (s[i][k] == s[j][k]) same |= (1 << k);         }         f[same] |= (1LL << j) | (1LL << i);       }     }     for (int same = (1 << m) - 1; same >= 0; same--) {       for (int i = 0; i < m; i++) {         if (same & (1 << i)) f[same ^ (1 << i)] |= f[same];       }     }     double ans = 0;     memset(dp, 0, sizeof(dp));     dp[0] = 1;     for (int sta = 0; sta < (1 << m); sta++) {       int cnt = 0;       for (int i = 0; i < m; i++)         if (sta & (1 << i)) cnt++;       for (int i = 0; i < m; i++) {         if (sta & (1 << i)) continue;         dp[sta | (1 << i)] += dp[sta] / (m - cnt);       }       for (int i = 0; i < n; i++) {         if (f[sta] & (1LL << i)) ans += dp[sta];       }     }     printf( %.10f n , ans / n);   }   