func_code_string: #include <bits/stdc++.h>   using namespace std;   inline long long getnum() {     char c = getchar();     long long num, sign = 1;     for (; c <  0  || c >  9 ; c = getchar())       if (c ==  - ) sign = -1;     for (num = 0; c >=  0  && c <=  9 ;) {       c -=  0 ;       num = num * 10 + c;       c = getchar();     }     return num * sign;   }   vector<int> V[100003];   double D[100003];   int ch[100003], par[100003];   void dfs(int n) {     ch[n] = 0;     for (int i = 0; i < V[n].size(); i++) {       int x = V[n][i];       dfs(x);       ch[n] += ch[x];     }     double sum = 0.5;     for (int i = 0; i < V[n].size(); i++) {       int x = V[n][i];       D[x] = sum * (ch[n] - ch[x]);     }     ch[n]++;   }   void ddfs(int n) {     D[n] += 1.0 + D[par[n]];     for (int i = 0; i < V[n].size(); i++) ddfs(V[n][i]);   }   int main() {     int n = getnum();     for (int i = 2; i <= n; i++) {       par[i] = getnum();       V[par[i]].push_back(i);     }     dfs(1);     ddfs(1);     for (int i = 1; i <= n; i++) printf( %0.8f  , D[i]);   }   