摘要:
做笔记:记忆化搜索的语法 #include<iostream> #include<cstdio> #define ll long long using namespace std; ll temp[55][55][55]; int w(ll a,ll b,ll c) { if(a<=0||b<=0| 阅读全文
摘要:
用dp [ i ]存放数列第 i 项,避免了每次递归时都要重复计算海量的项 运行时间从9s提升到0.001s #include<iostream> #include<ctime> using namespace std; int dp[55]; int f(int x) { if(x==1||x== 阅读全文