用f[i]表示前i个数,i必须被贡献的答案,考虑转移,枚举下一个被贡献的数j,那么j需要满足:1.$j<i$;2.$a[j]<a[i]$;3.$a[i]-(i-j+1)\le a[j]$,化简后即$j-a[j]\le i-a[i]$;4.$a[i]\le i$这是一个三维偏序,但发现第二个限制和第三 ...
分类:
其他好文 时间:
2019-12-21 10:05:47
阅读次数:
69
# a新增行数,d删除行数 git log --author="`git config --get user.name`" --pretty="%H" --after="2019-01-01" --numstat | awk 'NF==3 {a+=$1; d+=$2} END {printf("+% ...
分类:
其他好文 时间:
2019-12-20 21:07:41
阅读次数:
120
直接上案例: 例子:获取gerrit进程 方法:$ps -aux |grep nginx |grep -v grep |awk '{print $2}' 或者 $ps -ef |grep nginx |grep -v grep |awk '{print $2}' 例子:获取gerrit进程并kill ...
分类:
系统相关 时间:
2019-12-20 20:54:25
阅读次数:
128
数据库忘记装了,然后今天才装上。刚开始有点蒙蔽,进入mysql官网一堆英文,小声逼逼没有学号英语的我。废话不都说,直接上图 1、输入网址 https://www.mysql.com/downloads/ 2、点击Mysql Community Server 3、进去之后是最新版本,点击图上按钮就可以 ...
分类:
数据库 时间:
2019-12-20 18:35:41
阅读次数:
362
1 #include <stdio.h> 2 #include <string.h> 3 4 int main(void) 5 { 6 char str[5][80]; //二维数组保存5个字符串 7 int i, j; 8 9 for (i = 0; i < 5; i++) 10 { 11 sca ...
分类:
编程语言 时间:
2019-12-20 15:19:20
阅读次数:
79
通过文件的inode号删除文件 先用ls -i 找出要删除文件的inode 号 2ls -i |grep xxxxxx|awk '{print $2}'|xargs -i rm -f {} xxxxxx为文件的 inode 号 通过文件大小删除文件 删除当前目录以及所有子目录下的文件大小为零的文件 ...
分类:
系统相关 时间:
2019-12-20 10:25:53
阅读次数:
140
extra属性显示查询用了哪些资源,当select索引列的时候可以看到是使用了索引去查询的速度就很快 下图的查询方式虽然order_by是根据索引去排序的但是select*返回了多个列,有的列不是索引列,所以需要从磁盘中去查询,下图extra是filesort 实战中优化的一些小技巧 查询id用到主... ...
分类:
数据库 时间:
2019-12-20 09:15:40
阅读次数:
104
归并排序的算法是分治法的一个范例 Like QuickSort, Merge Sort is a Divide and Conquer algorithm.它被分成两半,调用自己来分两半,最后归并两半。 merge() 功能用于合并两半。The merge (arr,l,m,r)是关键的处理arr[ ...
分类:
编程语言 时间:
2019-12-19 23:46:00
阅读次数:
160
func (this *LoadBalance) RoundRobinByWeight3() *HttpServer { //平滑加权轮询 for _, s := range this.Servers { s.CWeight = s.CWeight + s.Weight } sort.Sort(th... ...
分类:
编程语言 时间:
2019-12-19 23:18:36
阅读次数:
131
#include <iostream>using namespace std; //数组打印void P(int a[], int n){ for (int i = 0; i<n; i++) cout << a[i] << " "; cout << endl;} int quickSortParti ...
分类:
编程语言 时间:
2019-12-19 23:05:34
阅读次数:
67