解题思路:
注意事项:
注意const int N=1e3+5不是1e3如果是1e3会数据越界
参考代码:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e3+5;
ll a[N][N];
int main()
{
a[1][1]=1;
for(int i=2;i<=1000;i++)
for(int j=1;j<=1000;j++)
a[i][j] = a[i-1][j]+a[i-1][j-1];
ll x,y;cin>>x>>y;
cout<<a[x][y];
return 0;
}
0.0分
1 人评分