C++:动态规划记忆化【涉及递归】 摘要:解题思路:记忆化就是把计算过的存储起来,下一次需要的时候直接使用就可以注意事项:参考代码:#include <iostream>#include<vector>using na…… 题解列表 2025年04月29日 0 点赞 0 评论 119 浏览 评分:0.0
为何正确率如此低? 摘要:```cpp #include using namespace std; const int N=1e6+10; int a[N]; int k,n; void dfs(int …… 题解列表 2024年05月30日 0 点赞 0 评论 310 浏览 评分:0.0
两种方式求解(递归超时,数组➕循环ac) 摘要:解题思路:循环+数组注意事项:因为数据太大,递归会超时,所以采用数组记录已经计算过的数值参考代码:#include<iostream>using namespace std;int f(int n){…… 题解列表 2023年11月13日 0 点赞 0 评论 447 浏览 评分:9.9
3021: Pell数列 摘要:```cpp #include using namespace std; int a[1000005]={0,1,2},k=0,n; int main() { cin>>n; …… 题解列表 2023年01月09日 0 点赞 2 评论 404 浏览 评分:9.9
3021: Pell数列 摘要:解题思路:Pell数列DP方法!要就复制吧,爱就点赞吧!注意事项:参考代码:#include<bits/stdc++.h> using namespace std; int a[1000005]=…… 题解列表 2023年01月03日 0 点赞 2 评论 574 浏览 评分:9.9