40分5个点MLE,1个点TLE求助

P1605 迷宫

**呃呃呃###额额**
by 郑涵希 @ 2018-01-04 20:03:10


###额
by 郑涵希 @ 2018-01-04 20:03:21


###额
by 郑涵希 @ 2018-01-04 20:03:34


**额**
by 郑涵希 @ 2018-01-04 20:03:43


```cpp #include<iostream> using namespace std; int n,m,ans,t,t1,t2,a[6][6],b[6][6],x0,y0,x1,y1; void dfs(int i,int j) { if(i<1||j<1||i>n||j>m) return; if(a[i][j]==1||b[i][j]==1) return; if (i==x1&&j==y1) { ans++; return ; } else { b[i][j]=1; dfs(i+1,j); dfs(i,j+1); dfs(i-1,j); dfs(i,j-1); b[i][j]=0; } } int main() { cin >> n >> m >> t; cin >> x0 >> y0 >> x1 >> y1; for (int i=1; i<=t; i++) { cin >> t1 >> t2; a[t1][t2]=1; } if(a[x0][y0]==1) cout<<"0"; dfs(x0,y0); cout<<ans; return 0; } ############################################################################################送你了 ```
by 郑涵希 @ 2018-01-04 20:04:59


###。
by 郑涵希 @ 2018-01-04 20:05:17


kg[](U2FsdGVkX1+iN9wh58aZU3M8E7inc45l65DCfXnQMPg=)
by 江户川·萝卜 @ 2020-07-12 09:22:12


kg [](123)
by juruojjl_ @ 2020-08-11 21:01:45


|