蒟蒻求助--c++5个wa了

P1255 数楼梯

_Jarvis_ @ 2022-10-29 07:55:13

#include<bits/stdc++.h>
using namespace std;
int n,f[5002];
int main(){
    //freopen("b.in","r",stdin);
    //freopen("b.out","w",stdout);
    cin>>n;
    f[1]=1;
    f[2]=2;
    for(int i=3;i<=n;i++){
        f[i]=f[i-1]+f[i-2];
    }
    cout<<f[n];
    //fclose(stdin);fclose(stdout);
    return 0;
}

by _Jarvis_ @ 2022-10-29 08:01:24

没用高精我50,我咋记得不用高精满分60来着,#4wa


by LsmQwQ @ 2022-10-29 08:39:33

@Jarvis 开个long long60pts


by _Jarvis_ @ 2022-10-29 09:11:25

@LsmQwQ 啊对对对谢谢,我刚刚去看了下月落乌啼算钱也发现忘long long了qwq


|