2018-03-28 16:02:04 socketserver 此模块简化了socket的编写。 1、它有一个基类,定义了如何建立连接。BaseServer提供了服务类接口,BaseServer使用了select创建了多线程。BaseServer下面有四个类:TCPServer、UnixStrea ...
分类:
其他好文 时间:
2019-03-09 12:58:39
阅读次数:
178
个人码风:大括号换行,4格缩进,轻微压行,行内空格极随意。 字符串 KMP c++ const int N=1000005; char s[N], t[N]; int len_s, len_t, nxt[N]; void GetNext(char s) { for (int i=2, k=0; iy ...
分类:
其他好文 时间:
2019-03-07 00:48:46
阅读次数:
150
题目描述 在未排序的数组中找到第 k 个最大的元素。请注意,你需要找的是数组排序后的第 k 个最大的元素,而不是第 k 个不同的元素。 解法1 时间复杂度:O(nlogn) 思路:使用快速排序,将数组排序,然后找到第k个最大的元素。这里需要复习一下快速一下快速排序的实现方法。 int partiti ...
分类:
其他好文 时间:
2019-03-06 10:39:06
阅读次数:
137
题目描述 "Luogu" 题目大意:给一棵$n$个点的树,求所有联通块中第$K$大的权值$W_k$之和。 数据范围:$K\leq n\leq 1666$ , $W_{max}\leq 1666$,答案对$64123$取模,时限$7sec$。 题解 $Ans = \sum_{S} Kth\ of\ S ...
分类:
其他好文 时间:
2019-02-08 01:15:02
阅读次数:
229
环境: Ubuntu18 vue+elementUI 实现文件的上传 报错信息: java.io.IOException: java.io.FileNotFoundException: /tmp/tomcat.2457258178644046891.8080/work/Tomcat/localhos ...
分类:
编程语言 时间:
2019-02-01 01:13:03
阅读次数:
1446
https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/ Given a n x n matrix where each of the rows and columns are sorted in ascending ...
分类:
其他好文 时间:
2019-01-30 21:45:57
阅读次数:
190
https://leetcode.com/problems/kth-largest-element-in-an-array/ Find the kth largest element in an unsorted array. Note that it is the kth largest elem ...
分类:
其他好文 时间:
2019-01-28 22:23:42
阅读次数:
188
Xiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the kth great n ...
分类:
其他好文 时间:
2019-01-27 13:03:02
阅读次数:
179
Machine Learning in Practice: kth-Nearest Neighbor ...
分类:
编程语言 时间:
2019-01-26 18:46:26
阅读次数:
234
https://leetcode.com/problems/kth-largest-element-in-a-stream/ 这个题目的意思解读了半天,没搞明白什么意思,后来画了一下图,一下子就明了 1.熟悉了一下怎么使用heapqd的常规函数 2.最后这个 ...
分类:
其他好文 时间:
2019-01-20 23:32:26
阅读次数:
212