题解列表

筛选

十六进制转八进制(C++)

摘要:解题思路:将十六进制先转为十进制,再转为八进制参考代码:#include<iostream>#include<cstring>#include<cmath>using namespace std;in……

深搜c++ 题目陷阱

摘要:解题思路:注意事项:输入cin>>n>>m通常默认为行数和列数,这里题目规定先输入列数,在输入行数参考代码:#include<iostream> using namespace std; int ……

0/1背包问题,一维数组求解

摘要:/* 背包问题基本01: 递推公式: w[i]: 商品占用价值; val[i]: 商品价值; f[v] = max(f[v],f[v-w[i]]+val[i]) */ ``` #i……

数据结构-折半插入排序

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

数据结构-直接插入排序

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

绝对值排序

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std; bool cmp(int a, int b);int main(){    int……

C语言训练-排序问题<2>

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