只有60分!

P1255 数楼梯

20110915_260 @ 2023-07-02 09:26:43

#include<bits/stdc++.h>
using namespace std;
long long a[5005];
int main(){
    long long n;
    cin>>n;
    a[1]=1;
    a[2]=2;
    for(int i=3;i<=n;i++){
        a[i]=a[i-1]+a[i-2];
    }
    cout<<a[n];
    return 0;
}

by Henry2012 @ 2023-07-02 09:27:34

开高精


by Henry2012 @ 2023-07-02 09:28:25


by linjunye @ 2023-07-02 09:30:17

题解里都提到高精度了,显然不是longlong就能搞定的。


by jzl15880255743 @ 2023-07-02 10:33:45

@20110915_260 数据范围太大了


by 20110915_260 @ 2023-07-02 10:35:05

我真的会谢谢你! @jzl15880255743


by jzl15880255743 @ 2023-07-02 10:36:08

@20110915_260 不用谢


by 20110915_260 @ 2023-07-02 10:37:25

我必须要蟹蟹你!晚上去你家偷马桶盖!@jzl15880255743


|