【算法】DP
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<cstdio> #include<algorithm> using namespace std; const int MOD=1000000007,maxn=1010; int f[maxn][maxn]; int mods(int x) {return x>MOD?x-MOD:x;} int main() { int n,m; scanf("%d%d",&n,&m); f[0][1]=1; for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { f[i][j]=mods(f[i-1][j]+f[i][j-1]); } } printf("%d",f[n][m]); return 0; }