50分,示例过了,求解
  • 板块P1255 数楼梯
  • 楼主hank119
  • 当前回复4
  • 已保存回复4
  • 发布时间2024/11/24 14:22
  • 上次更新2024/11/24 16:24:38
查看原帖
50分,示例过了,求解
1272262
hank119楼主2024/11/24 14:22
#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;
}
2024/11/24 14:22
加载中...