Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
20774 LeoWang 过河卒 C++ 通过 0 MS 264 KB 543 2023-06-20 08:22:25

Tests(5/5):


#include<bits/stdc++.h> using namespace std; bool vis[30][30]; long long dp[30][30]; int n,m,x,y; int main(){ dp[1][1]=1; cin>>n>>m>>x>>y; n++; m++; x++; y++; vis[x][y]=1; vis[x-2][y-1]=1; vis[x-2][y+1]=1; vis[x+2][y-1]=1; vis[x+2][y+1]=1; vis[x-1][y+2]=1; vis[x-1][y-2]=1; vis[x+1][y+2]=1; vis[x+1][y-2]=1; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(i==1&&j==1) continue; if(vis[i][j]==0) dp[i][j]=dp[i-1][j]+dp[i][j-1]; } } cout<<dp[n][m]; return 0; }


测评信息: