幽灵特工 @ 2020-09-29 12:29:56
(1/sqrt(5))*(pow((1+sqrt(5))/2,n+1)-pow((1-sqrt(5))/2,n+1)))
#include <bits/stdc++.h>
using namespace std;
int x[5010][5010];
int main(){
int n;
cin>>n;
cout<<(1/sqrt(5))*(pow((1+sqrt(5))/2,n+1)-pow((1-sqrt(5))/2,n+1));
}
by 鏡音リン @ 2020-09-29 12:42:19
高精题您非得用浮点数算么
by zimujun @ 2020-09-29 12:42:36
打递推吧
by zimujun @ 2020-09-29 12:43:34
发现一只铃酱qwq
by ysomething @ 2020-09-29 12:50:21
@幽灵特工 递推简单些吧
by 幽灵特工 @ 2020-09-29 12:54:37
逃
by fzj2007 @ 2020-09-29 14:14:45
@sth2627123304 矩乘时间好吧(逃)
by tiger0134 @ 2020-09-29 14:16:21
存