一开始写成了step++,结果就少一个,看来还是不能太浪
#include <iostream>#include <cstring>#include <string>#include <vector>#include <queue>#include <cstdio>#include <set>#include <cmath>#include <algorithm>#include <queue>#define INF 0x3f3f3f3f#define MAXN 100005#define Mod 10001using namespace std;int ans;void dfs(int num,int step){ if(num>=39) { if(step%2==0&&num==39) ans++; return; } for(int i=1;i<=2;++i) { dfs(num+i,step+1); }}int main(){ ans=0; dfs(0,0); cout<<ans<<endl; return 0;}新闻热点
疑难解答
图片精选