求助
查看原帖
求助
486441
13833925596mm楼主2022/7/3 10:15
#include <bits/stdc++.h>
using namespace std;
int a,b,n,x,y;
int f[2000][2000];
int main(){
	cin>>a>>b>>n;
	for(int i=1;i<=a+1;i++) for(int j=1;j<=b+1;j++) f[i][j]=1;
	for(int i=1;i<=n;i++){
	    cin>>x>>y;
	    f[x][y]=0;
	}
	for(int i=2;i<=a;i++) for(int j=2;j<=b;j++) if(f[i][j]!=0) f[i][j]=f[i-1][j]+f[i][j-1];
	/*for(int i=1;i<=a;i++){
		for(int j=1;j<=b;j++) cout<<f[i][j]<<' ';
		cout<<endl;
	}*/
    cout<<f[a][b];
    return 0;
}
2022/7/3 10:15
加载中...