题目
题目链接
题解我未曾设想的道路。我居然以为是高精度的矩阵快速幂,差点心态崩了,直接看了题解……
1 ~ 50 打个表,发现到20,小数点后八位就不变了,所以……,解决。
#include
using namespace std;
typedef long long LL;
const int N = 30;
int main()
{
LL n, f[N];
cin >> n;
f[1] = f[2] = 1;
for (int i = 3;i = 20) printf ("0.61803399");
else printf ("%.8lf\n", 1.0 * f[n] / f[n+1]);
return 0;
}