阿晨1998
1234567891011121314151617181920212223242526272829303132#include "iostream"#include <string.h>using namespace std;int c = 0;int n, m, num;int arr[20][20];void search(int x, int y){ if (x > n || y < 1) return; if(arr[x][y] == 1) //碰到黑洞 return; if (x == n && y == 1) c++; search(x + 1, y); search(x, y - 1); return;}int main(){ int x, y; memset(arr, 0,sizeof arr); cin >> n >> m >> num; for (int i = 0; i < num; i++) { cin >> x >> y; arr[x][y] = 1; //1代表黑洞 } search(1, m); cout << c << endl; return 0;}