五个点AC,求调

P1255 数楼梯

dandan2012 @ 2024-09-10 19:42:47

代码:


using namespace std;
int m;
int dp[1010];
int main(){
    dp[1]=1;
    dp[2]=2;
    for(int i=3;i<=1010;i++){
        dp[i]=dp[i-1]+dp[i-2];
    }
    cin>>m;
    cout<<dp[m];
    return 0;
}
``

by huanglihuan @ 2024-09-10 19:47:22

高精


by str_awa @ 2024-09-10 19:48:34

@dandan2012 int过不了,需要int128或高精


by lijunshen @ 2024-10-20 22:35:05

unsigned long long也行


|