#在线求助 5个点全wa

P1002 [NOIP2002 普及组] 过河卒

(qwq)
by xiayunpeng @ 2023-02-22 19:31:34


请您再读一遍题目 ![](https://cdn.luogu.com.cn/upload/image_hosting/gdords75.png) ![](https://cdn.luogu.com.cn/upload/image_hosting/gdords75.png) ![](https://cdn.luogu.com.cn/upload/image_hosting/gdords75.png)
by Stasis @ 2023-02-24 23:50:23


?
by xiayunpeng @ 2023-02-26 10:43:11


改了,还是不对 ```cpp #include<bits/stdc++.h> using namespace std; int n, m, p, q; int a[25][25]; int hx[8]={1,1,-1,-1,2,2,-2,-2}; int hy[8]={2,-2,2,-2,1,-1,1,-1}; int f(int x,int y){ if(x==1&&y==1)return 1; else if(a[x][y]==-1)return 0; return f(x-1,y)+f(x,y-1); } int main() { ios::sync_with_stdio(false), cin.tie(0); cin >> n >> m >> p >> q; n++,m++,p++,q++; for (int i = 0; i < 8; i++) { int x=p+hx[i], y=q+hy[i]; if(x<=n&&x>0&&y<=m&&y>0) a[x][y]=-1; } a[p][q]=-1; // for (int i = 1; i <= n; i++) { // for (int j = 1; j <= m; j++) { // if (a[i][j]==0) cout << " "<< a[i][j]; // else cout << ' ' << a[i][j]; // } // cout << '\n'; // } cout << f(n,m); return 0; } ```
by xiayunpeng @ 2023-02-26 10:56:50


十年OI一场空,不开longlong见祖宗
by Po7ed @ 2023-03-29 21:01:25


@[xiayunpeng](/user/767465) a数组要开longlong
by Po7ed @ 2023-03-29 21:02:02


|