public class SortHeap { public static void sort(int[] data) { // 构建大顶堆 for (int i = (data.length - 2) / 2; i >= 0; i--) { adjustHeap(data, i, data.len ...
分类:
编程语言 时间:
2020-03-06 12:56:17
阅读次数:
70
<!--下布转数--><el-table-columnalign="right"width="87px"><templateslot="header"slot-scope="scope"><spanclass="sort-table-header">下布转数</span></template><templateslot-
分类:
其他好文 时间:
2020-03-06 09:17:56
阅读次数:
515
<!--下布转数--><el-table-columnalign="right"width="87px"><templateslot="header"slot-scope="scope"><spanclass="sort-table-header">下布转数</span></template><templateslot-
分类:
其他好文 时间:
2020-03-06 09:16:34
阅读次数:
127
list1 = [{'a':1,'b':2},{'a':2,'b':4},{'a':3,'b':5}] #lambda 参数1,参数2 :返回值表达式 print(max(list1,key=lambda x:x['a'])) #max 中key 就相当于sort中的cmp,传入一个参数设置了排序方 ...
分类:
编程语言 时间:
2020-03-05 21:00:12
阅读次数:
75
std::string uint2string(const uint32_t value, int radix /*= 10*/) { std::string strString = ""; switch (radix) { case 10: strString = std::to_string(v ...
分类:
其他好文 时间:
2020-03-05 18:02:00
阅读次数:
84
数组更新检测 在 vue 中使用数组的push()、pop()、shift()、unshift()、splice()、sort()、reverse() 、filter()、concat() 方法时,改变数组的同时可以触发视图的变化。 注意: 有两种情况 vue 无法检测到变动的数组,分别是: (1) ...
分类:
编程语言 时间:
2020-03-05 13:20:14
阅读次数:
95
判断是否是插入排序的部分与 1035 插入与归并一样。 本题主要考察 堆排序的实现。 首先,把所有双亲结点进行向下调整; 然后,重复 n-1 次操作,即 把堆顶元素与待排序区的最后一个元素交换并对堆顶元素向下调整。 1 #include<iostream> 2 #include<algorithm> ...
分类:
其他好文 时间:
2020-03-05 13:11:47
阅读次数:
66
https://www.luogu.com.cn/problem/P1546 #include<bits/stdc++.h> #define N 1000 using namespace std; struct node{ int x,y,w; bool const < (node &o){ ret ...
分类:
其他好文 时间:
2020-03-05 00:49:04
阅读次数:
69
1 #include <uf.h> 2 #include <uf_ui.h> 3 #include <uf_obj.h> 4 #include <uf_modl_primitives.h> 5 #include <uf_csys.h> 6 #include <uf_layer.h> 7 #inclu ...
分类:
其他好文 时间:
2020-03-04 23:38:17
阅读次数:
147
https://codeforces.com/gym/100340/problem/A 题目 老人给n个小学生发m个饼干,每人最少一个,最后都发完了。这些小学生每个人都有一个贪心值g,如果有x个人的饼干比他多,那么他的不高兴指数就是$gx$ 给出n,m,所有贪心值,输出不高兴指数的和的最小值,同时输 ...
分类:
其他好文 时间:
2020-03-04 23:08:47
阅读次数:
57