快速排序 void quick_sort(int a[],int l,int r){ if(l >= r) return; int i = l - 1, j = r + 1; int x = a[l + r >> 1]; //这里向下取整,因为后面用到的是j,如果是用的i,则应该是int x = a ...
分类:
编程语言 时间:
2021-01-01 11:57:09
阅读次数:
0
1、定义 数组中的元素可以按字母或数字顺序进行降序或升序排列。 2、数组排序函数,修改了原来的数组 sort() - 对数组进行升序排列 rsort() - 对数组进行降序排列 asort() - 根据关联数组的值,对数组进行升序排列 ksort() - 根据关联数组的键,对数组进行升序排列 ars ...
分类:
编程语言 时间:
2020-12-30 11:38:46
阅读次数:
0
计划任务crontab-e*/1****sudosh/root/redis/redis_cluster/7003-cron.sh脚本#!/bin/shredis=`netstat-an|grep":7003"|awk‘$1=="tcp"&&$NF=="LISTEN"{print$0}‘|wc-l`if[$redis-eq0];then#端口被占用执行如下sudo/root/redi
分类:
其他好文 时间:
2020-12-30 11:20:41
阅读次数:
0
# 1. python【字典】转json格式【str】 import json dic = {'a': 1, 'b': 2, 'c': 3} str1 = json.dumps(dic, sort_keys=True, indent=4, separators=(',', ':')) str2 = ...
分类:
编程语言 时间:
2020-12-30 11:14:48
阅读次数:
0
pipeline { agent any environment { imagename = '镜像名' tag = "v${BUILD_NUMBER}" #版本号 } stages { stage('Pull code') { steps { echo "${imagename}:${tag}" ...
分类:
其他好文 时间:
2020-12-29 11:15:03
阅读次数:
0
improt.org.springframework.data.domain.sort包Criterialcritel=newCriterial();criterl.and("createTime").is(req.getCreateTime())Sortsort=Sort.by(sort.Diretion.DESC,mongod库对应属性)mongoTempalate.fin
分类:
数据库 时间:
2020-12-29 11:05:45
阅读次数:
0
linux 看cpu、内存、虚拟内存、磁盘查、 查看物理cpu个数 cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l 查看物理cpu内核个数 cat /proc/cpuinfo | grep "cpu cores" | uniq ...
分类:
系统相关 时间:
2020-12-28 10:56:23
阅读次数:
0
考虑莫队。 如果是单纯的莫队的话,还需要一个树状数组来维护逆序对数,这样子的话复杂度是 \(O(n^{1.5}\log n)\),难以接受。 怎么将这个树状数组消除? 考虑当前区间为 \([l,r-1]\) ,需要将右端点向右移动,即加入 \(a_r\) ,并且将答案加上 \(a_{l,l+1,\c ...
分类:
其他好文 时间:
2020-12-25 12:28:35
阅读次数:
0
1.错误信息∶{"Message" : "必须至少有一个对象实现lComparable。" } 错误原因:lambda表达式多字段排序 OrderBy(m => new {m.CategoryType, m.Sort}) 正确写法:OrderBy(m => m.CategoryType).ThenB ...
分类:
其他好文 时间:
2020-12-23 12:14:26
阅读次数:
0
Ubuntu 18.04 彻底卸载MySQL 5.7.31 1. 查看MySQL的依赖项 dpkg --list|grep mysql 2. 卸载 mysql-common sudo apt remove mysql-common 3. 卸载 mysql-server sudo apt autore ...
分类:
数据库 时间:
2020-12-22 13:13:25
阅读次数:
0