acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • jie

    #include<bits/stdc++.h> using namespace std; int dx[] = {0, -2, -1, 1, 2, 2, 1, -1, -2}; int dy[] = {0, 1, 2, 2, 1, -1, -2, -2, -1}; int bx,by,cx,cy; long long f[30][30]; bool s[30][30]; int main(){ cin>>bx>>by>>cx>>cy; bx+=2; by+=2; cx+=2; cy+=2; f[2][2] = 1; s[cx][cy] = 1; for(int i = 1; i <= 8; i++)s[cx+dx[i]][cy+dy[i]]=1; for(int i = 2; i <= bx; i++){ for(int j = 2; j <= by; j++){ if(s[i][j]) continue; f[i][j] = max(f[i][j],f[i-1][j]+f[i][j-1]); } } cout<<f[bx][by]; return 0; }

    userId_undefined

    181****0362

    8阅读
    0回复
    0点赞
首页