40分超时!!!求助大佬!!!
  • 板块P2437 蜜蜂路线
  • 楼主cx2013
  • 当前回复1
  • 已保存回复1
  • 发布时间2024/7/7 14:19
  • 上次更新2024/7/7 16:23:48
查看原帖
40分超时!!!求助大佬!!!
1339620
cx2013楼主2024/7/7 14:19
#include<bits/stdc++.h>
using namespace std;
int n,m;
int f(int n){
    if(n==m)return 1;
    if(n==m+1)return 1; 
    return f(n-1)+f(n-2);
}
int main(){
    cin>>m>>n;
    cout<<f(n);
    
    return 0;
}
2024/7/7 14:19
加载中...