【C++】采药 动态规划思路 摘要:解题思路:其实最开始我(蒟蒻)看到这道题想用贪心来做,结果贪心是真的不适合寻找全体的最优解。深搜的话感觉还是有些复杂,要保留记忆,所以便使用动态规划来求,这样其实还挺简单的。代码不长也比较好理解。(b…… 题解列表 2023年06月22日 0 点赞 0 评论 662 浏览 评分:9.9
明明的随机数(真的是随机数,求大佬指出错误!) 摘要:解题思路:注意事项:参考代码:#include <iostream>#include<ctime>#include<cstdlib>using namespace std;int main(){ i…… 题解列表 2023年06月21日 0 点赞 0 评论 340 浏览 评分:9.9
【c++】校门外的树 统计数组和的技巧 摘要:解题思路:发现这道题以前在lg上面写过,就把代码放过来,顺便本蒟蒻水一篇题解。其实这道题我将有树的地方赋值为1,反则为0,这样可以通过把数组相加得到树的个数,有点巧妙。注意事项:虽然但是,如果时间要求…… 题解列表 2023年06月21日 0 点赞 0 评论 471 浏览 评分:9.9
【c++】蛇形矩阵简单易懂 摘要:解题思路:本蒟蒻想到了先建立出一个不少于100x100的蛇形矩阵保存,在根据用户所输入的行列数进行输出。注意事项:输出的行列数参考代码:#include <iostream>#include <bit…… 题解列表 2023年06月21日 0 点赞 0 评论 602 浏览 评分:9.3
题目 1378: C hicken and rabbit s题解 摘要:1.解题思路注意鸡的腿数和兔的腿数都是偶数,不可能共有奇数条腿,所以当m%2==1时,输出0 0.否则,最多只动物时,全都是鸡,输出m/2;最少只动物时,全都是兔,输出celi(m/4).2.参考代码…… 题解列表 2023年06月21日 0 点赞 0 评论 392 浏览 评分:9.9
蓝桥杯算法提高VIP-盾神与砝码称重 摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;#define maxlen 28int n, m;int fm[maxlen]; int…… 题解列表 2023年06月19日 0 点赞 0 评论 616 浏览 评分:0.0
2种递归写法 摘要:解题思路: #include <bits/stdc++.h>using namespace std;int pd(int m){ if(m<=0) return 0; if(m==1) r…… 题解列表 2023年06月19日 1 点赞 0 评论 431 浏览 评分:0.0
哇靠送分题*2 摘要:解题思路:思考注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a,b,c; while(cin>>a>>b>…… 题解列表 2023年06月19日 0 点赞 0 评论 836 浏览 评分:0.0
哇靠送分题 摘要:解题思路:注意事项:小小的改一下题目参考代码:#include<iostream>using namespace std;int main(){ int a,b,c; while(cin>…… 题解列表 2023年06月19日 0 点赞 0 评论 895 浏览 评分:0.0
[编程入门]数字的处理与判断 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;#include<cmath>int main(){ int num = 0; int tem…… 题解列表 2023年06月18日 0 点赞 0 评论 281 浏览 评分:0.0