孱弱求助,两个TLE,一个MLE!!!(c++)
查看原帖
孱弱求助,两个TLE,一个MLE!!!(c++)
552448
XYZLT楼主2023/9/11 19:51
#include<bits/stdc++.h>
using namespace std;
double f(int x){
	if(x==1||x==2) return 1.0; 
	else return f(x-1)+f(x-2); 
} 
int main()
{
	int x;
	cin>>x;
	printf("%.2lf",f(x));
	return 0;
}
2023/9/11 19:51
加载中...