https://www.luogu.com.cn/record/196924125
#include<bits/stdc++.h>
using namespace std;
double s;
int n;
long long t=1;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
t*=i,s+=1/(t*1.0);
printf("%.10lf",s+1);
return 0;
}
https://www.luogu.com.cn/record/196924143
#include<bits/stdc++.h>
using namespace std;
long double s;
int n;
long long t=1;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
t*=i,s+=1/(t*1.0);
printf("%.10lf",s+1);
return 0;
}
rt