题解列表

筛选

蚂蚁感冒解题方法

摘要:解题思路:注意题目中说明第一个输入的数据为感冒的蚂蚁,正数为向右移动的蚂蚁,负数为向左移动的蚂蚁如果两只相邻的蚂蚁是同向移动,是不会相遇的,也就是不会掉头用给出的案例来讲解下-10 8 -20 12 ……

Huffuman树费用--python

摘要:解题思路:注意事项:参考代码:def create_huffman(nums):     cost = 0     while len(nums) > 1:         pa = nums.……

蓝桥杯算法提高-快速排序

摘要:解题思路:注意事项:快排时,先从右向左找小于基准值的数交换,再从左向右找大于基准数的值交换。参考代码:#include <iostream>using namespace std;void Quick……

求最小绝对值

摘要:```cpp #include using namespace std; int main() { int a[11],b[11]; for(int i=0;i>a[i]; b……

自定义函数

摘要:```cpp #include using namespace std; double fact(int n){ double a,b=1.0; for(a=1;ax>>n; fo……