hank119 @ 2024-11-24 14:22:00
#include <bits/stdc++.h>
using namespace std;
const int N=1e5+10;
long long n,a[N];
int dt(int x){
if(x==0||x==1) return 1;
return dt(x-1) + dt(x-2);
}
int main(){
cin>>n;
cout<<dt(n);
return 0;
}
by kevinZ99 @ 2024-11-24 14:24:05
@hank119
两个问题
1、复杂度不对,建议 记忆化 或 递推
2、高精度
by hank119 @ 2024-11-24 14:28:18
@kevinZ99 高精度怎么搞?
by kevinZ99 @ 2024-11-24 14:32:11
@hank119
额,百度,字符串模拟或者换python
by hank119 @ 2024-11-24 14:33:58
@kevinZ99谢谢