Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <cstdio>#include <cstring>#include <algorithm>#include <vector>#include <queue>#include <set>#include <map>using namespace std;typedef long long ll;const int maxn = 500 + 10;double a[maxn];int n;double dp(int x) {if(x == 0)return 1.0;if(a[x] != -1)return a[x];a[x] = 0;for(int i = 0; i < x; i++)for(int j = 0; j < x; j++)a[x] += dp(i) + dp(j);a[x] /= x * x;return a[x];}int main(){