From 740b1366e60f0033424099069e35af356ea8c383 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Mon, 24 Oct 2016 16:48:52 +0800 Subject: [PATCH] Create 1865.cpp --- QUSTOJ/1865.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 QUSTOJ/1865.cpp diff --git a/QUSTOJ/1865.cpp b/QUSTOJ/1865.cpp new file mode 100644 index 0000000..c230cd9 --- /dev/null +++ b/QUSTOJ/1865.cpp @@ -0,0 +1,22 @@ +#include +using namespace std; + +double ans[50]; +int vis[50]; + +double dfunc(int n,int x) +{ + if(n==0) return 1; + if(n==1) return x; + if(vis[n]) return ans[n]; + vis[n]=1; + return ans[n]=double((2*n-1)*x*dfunc(n-1,x)-(n-1)*dfunc(n-2,x))/n; +} + +int main() +{ + int a,b; + cin>>a>>b; + cout<