标签:计数 org 总结 tps dfs https 思想 遇到 动态
#include <iostream>
#include <cstdio>
int dfs(int x)
{
if(状态[x]保存过) return 状态[x];
if(到达目的地) return 递归最底层的解
int tot=0; //执行到这里说明状态[x]没被保存过,定义变量tot为方案数
for(int i=1;i<=算符种数;i++)
tot+=分支方案数
状态[x]=tot;
return 状态[x];
}
int main()
{
cout<<dfs(x); //输出以x为开始的方案数
return 0;
}
标签:计数 org 总结 tps dfs https 思想 遇到 动态
原文地址:https://www.cnblogs.com/BigYellowDog/p/9736028.html