数的计数(Noip2001) 记忆化 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义一个全局数组kkk,用于存储中间计算结果 int kkk[110…… 题解列表 2024年11月23日 0 点赞 0 评论 703 浏览 评分:0.0
3028: 数的计数(Noip2001) 摘要:```cpp #include using namespace std; int h[1001],s[1001]; int main() { int n; cin>>n;…… 题解列表 2023年01月09日 0 点赞 0 评论 1345 浏览 评分:9.9
时间超限来看 有注释!!! 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int n,num,a[10001]; int f1(int n){ if(a[n]…… 题解列表 2023年01月09日 0 点赞 0 评论 974 浏览 评分:9.9
AC :简单递归+备忘录优化解决问题;个人的一点理解,望给高分鼓励鼓励 摘要:解题思路:问题的解决类似树结构,子问题与母问题都是求解,从1到n/2数的个数。注意事项:测试代码中有一个为1000.结果数值较大。参考代码:#include<iostream> #include<s…… 题解列表 2023年03月09日 0 点赞 0 评论 1317 浏览 评分:9.9
3028: 数的计数(Noip2001) 递推前缀和 解题思路:自然数的个数递推式:h[i]=h[1]+h[2]+...+h[i/2];s[i]为h[i]前缀和,所以h[i]=1+s[i/2](扩展出的自然数包括i本身);计算前缀和s[i]=s[i-1]+h[i];注意事项:参考代码:#include#includeu 题解列表 2023年12月27日 0 点赞 0 评论 747 浏览 评分:9.9