[TJOI2015] theory of probability - generating function desired &&

The meaning of problems

Seeking a desired number of leaf nodes n-$ $ contains an ordered binary tree of nodes. ($ N \ leq 10 ^ 9 $)

analysis

A bunch of derivation .....

Get $ ans = \ frac {n (n + 1)} {2 (2n-1)} $

#include<bits/stdc++.h>
using namespace std;

double n;

int main()
{
    scanf("%lf", &n);
    printf("%.10lf\n", n*(n+1)/2/(2*n-1));
    return 0;
}

BZOJ been WA, I thought it was double the accuracy problems.

Recommendations to Los Valley post ( link ), (on BZOJ link ) does not seem to SPJ, .9f can only be written over.

 

Guess you like

Origin www.cnblogs.com/lfri/p/11567635.html