参考01背包 摘要:解题思路:容量换成甜度注意事项:只有一个值(甜度),只需要算对应格参考代码:#include<stdio.h>int main(){ int n,dp[100]={0},a,v; scan…… 题解列表 2023年12月08日 0 点赞 0 评论 778 浏览 评分:8.0
题解 2782: 整数大小比较 摘要:解题思路:无注意事项:要注意:c++中的“=”是“==”参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int a,b;…… 题解列表 2023年12月09日 0 点赞 0 评论 623 浏览 评分:8.0
短除法解题 解题思路:两正整数m,n最大公因数A最小公倍数B如上80=16*5,75=15*5其中5为80,75的最大公因数两者的最小公倍数为16*15*5或者说(80/5)*(75/5)*5从上面的例子可知m,n的最小公倍数B=(m/A)*(n/A)*A以上我们解决了最小公倍数, 题解列表 2023年12月10日 0 点赞 1 评论 626 浏览 评分:8.0
字符与ascll码值的转换 解题思路:注意事项:补充题解中Python代码空缺参考代码:print(ord("t"))print(chr(63)) 题解列表 2023年12月12日 0 点赞 2 评论 1042 浏览 评分:8.0
二叉树遍历(python) 摘要:解题思路:注意事项:参考代码:# 定义树节点的数据结构class TreeNode: def __init__(self, val): self.val = val …… 题解列表 2023年12月17日 0 点赞 0 评论 683 浏览 评分:8.0
编写题解 2751: 超级玛丽游戏 摘要:解题思路: ******** ************ ####....#. #..###.....##.... …… 题解列表 2023年12月24日 0 点赞 1 评论 594 浏览 评分:8.0
题解 2914: 铺地毯 #includeusingnamespacestd;constintN=10010;inta[N],b[N],g[N],k[N];intmain(){intn;cin>>n;for(inti=1;i>a[i]>>b[i]>>g[i]>>k[i];}intx, 题解列表 2023年12月24日 1 点赞 0 评论 495 浏览 评分:8.0
简单易懂的答案 摘要:解题思路:注意事项:参考代码:#include<stdio.h>void paixu(int array[]){ int i; int j; int k; for(i …… 题解列表 2023年12月31日 0 点赞 0 评论 449 浏览 评分:8.0
题解 2000 偶数列举 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ int n; cin>>n; for(i…… 题解列表 2024年01月08日 0 点赞 0 评论 589 浏览 评分:8.0
题解 2816: 统计满足条件的4位数个数 摘要:解题思路:先定义并输入n个数,再定义sum=0,再写循环并在循环里求出四位的数,再让他们进行运算,如果大于零就累加sum,最后输出sum。注意事项:要定义sum=0。参考代码:#include <bi…… 题解列表 2024年01月11日 0 点赞 0 评论 720 浏览 评分:8.0