编译错误,找不到555
查看原帖
编译错误,找不到555
550816
Freddymo楼主2021/8/24 21:11
#include <bits/stdc++.h>
using namespace std;
const int maxn=100005;
int dp[maxn][maxn];
int main()
{
    int n,m;
    cin>>n>>m;
    dp[0][1]=1;
    for(int i=1;i<=m;i++)
    {
        for(int j=1;j<=n;j++)
        {
            if(j==1)
            {
                dp[i][j]=dp[i-1][n]+dp[i][2];
            }
            else if(j==n){
                dp[i][j]=dp[i-1][1]+dp[i-1][n-1];
            }
            else
            {
                dp[i][j]=dp[i-1][j-1]+dp[i-1][j+1];
        
            }    
        }
    }
    cout<<dp[m][1];
    return 0;
}
2021/8/24 21:11
加载中...