最后四个超时了,球球大佬救救我

P1255 数楼梯

aaa3303 @ 2024-03-11 13:49:49

#include<stdio.h>
unsigned long long int jump[10000];
void Climb(int n){
    int i;
    jump[1]=1;
    jump[2]=2;
    for(i=3;i<=n;i++){
        jump[i]=jump[i-1]+jump[i-2];
    }
} 
int main(){
    int n;
    //n为阶梯数
    scanf("%d",&n);
    Climb(n);
    printf("%llu",jump[n]);
}

by __My0217__ @ 2024-03-11 13:55:44

使用高精度


by chenyyegg @ 2024-03-11 13:56:49

@My0217 __int 128 不能用吧


by aaa3303 @ 2024-03-11 13:56:56

啊,我还没学过高精度emmmm


by __My0217__ @ 2024-03-11 13:59:04

@chenyyegg sry 没看数据范围


by pengzhihzi @ 2024-03-11 16:17:05

又有for 又有递归,你这不给自己整卡住了吗


by sapo1o @ 2024-03-11 23:13:30

@pengzhihzi 递归在哪里??


by aaa3303 @ 2024-03-18 12:52:56

@pengzhihzi 老师要求要用递归emmmmm


by cccckick @ 2024-11-17 14:25:08

@chenyyegg为啥不能高精度


|