全是MLE怎么办?
查看原帖
全是MLE怎么办?
564427
SiXinchen楼主2021/9/25 18:09

哪位大佬可以帮看看。

#include<bits/stdc++.h>
using namespace std;
int b[2],c[2],ans=0;
int gh(int x,int y){
  if(x==b[0]&&y==b[1]){
    ans++;
    return 0;
  }
  else if(c[0]-2==x&&c[1]-1==y)return 0;
  else if(c[0]-1==x&&c[1]-2==y)return 0;
  else if(c[0]-2==x&&c[1]+1==y)return 0;
  else if(c[0]-1==x&&c[1]+2==y)return 0;
  else if(c[0]+2==x&&c[1]-1==y)return 0;
  else if(c[0]+1==x&&c[1]-2==y)return 0;
  else if(c[0]+2==x&&c[1]+1==y)return 0;
  else if(c[0]+1==x&&c[1]+2==y)return 0;
  gh(x+1,y);
  gh(x,y+1);
}
int main(){
  cin>>b[0]>>b[1]>>c[0]>>c[1];
  gh(0,0);
  cout<<ans;
  return 0;
}

(本人萌新,啥也不会)

2021/9/25 18:09
加载中...