题解
2024-12-15 10:46:15
发布于:北京
14阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
bool vis[1010][1010];
int a[1010][1010];
int main(){
int n,m;
cin >>n >>m;
for (int i=1;i<=m;i++) {
int x,y;
cin >>x >>y;
vis[x][y]=true;
}
a[1][1]=1;
for (int i=1;i<=n;i++) {
for (int j=1;j<=n;j++) {
if (vis[i][j]==true) {
a[i][j]=0;
} else if (i==1&&j==1) {
a[i][j]=1;
} else {
a[i][j]=(a[i-1][j]%100003+a[i][j-1]%100003)%100003;
}
}
}
cout <<a[n][n];
return 0;
}
这里空空如也
有帮助,赞一个