题解列表

筛选

参考01背包

摘要:解题思路:容量换成甜度注意事项:只有一个值(甜度),只需要算对应格参考代码:#include<stdio.h>int main(){    int n,dp[100]={0},a,v;    scan……

题解 2782: 整数大小比较

摘要:解题思路:无注意事项:要注意:c++中的“=”是“==”参考代码:#include <bits/stdc++.h>using namespace std;int main(){    int a,b;……

短除法解题

摘要:解题思路:两正整数m,n最大公因数A最小公倍数B如上80=16*5,75=15*5其中 5 为80,75的最大公因数两者的最小公倍数为 16*15*5 或者说 (80/5)*(75/5)*5从上面的例……

字符与ascll码值的转换

摘要:解题思路:注意事项:补充题解中Python代码空缺参考代码:print(ord("t"))print(chr(63))……

二叉树遍历(python)

摘要:解题思路:注意事项:参考代码:# 定义树节点的数据结构class TreeNode:    def __init__(self, val):        self.val = val        ……

题解 2914: 铺地毯

摘要: #include using namespace std; const int N=10010; int a[N],b[N],g[N],k[N]; in……

简单易懂的答案

摘要:解题思路:注意事项:参考代码:#include<stdio.h>void paixu(int array[]){     int i;     int j;     int k;     for(i ……

题解 2000 偶数列举

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    int n;    cin>>n;    for(i……

题解 2816: 统计满足条件的4位数个数

摘要:解题思路:先定义并输入n个数,再定义sum=0,再写循环并在循环里求出四位的数,再让他们进行运算,如果大于零就累加sum,最后输出sum。注意事项:要定义sum=0。参考代码:#include <bi……