给两个已经排序好的数组A,B,和一个常数k, 找i,j使得 Ai + Bj - k 的绝对值最小 分析: Two pointer, i从A从前往后扫,j从B从后往前扫.if (A[i]+B[j] > k){ j--;}else { i++;}整个过程不断更新答案 ...
分类:
其他好文 时间:
2020-02-06 12:27:56
阅读次数:
53
Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix in diagonal order as shown in the below image. Example: Input: ...
分类:
其他好文 时间:
2020-02-06 10:46:38
阅读次数:
71
一道很好的题了,具体题解可以看b站的讲解。。 拆点的思想有一种2sat的感觉 /* 给定一组开关的集合,每个开关最多被两个集合包含,对集合操作一次则所有集合内的开关状态变化 现在要将前i个开关状态切换到开,问最少要操作几次集合,求出i从1到n的每个答案 一些性质:每个集合要么被操作一次,要么不被操作 ...
分类:
其他好文 时间:
2020-02-06 01:00:54
阅读次数:
72
1.查找文件find / -name filename.txt根据名称查找/目录下的filename.txt文件。 2.查看一个程序是否运行ps –ef|grep tomcat查看所有有关tomcat的进程 3.终止线程kill -9 19979终止线程号位19979的线程 4.查看文件,包含隐藏文 ...
分类:
系统相关 时间:
2020-02-05 21:47:15
阅读次数:
94
今天继续学习UI的组件知识,包括文本框,编辑框,普通按钮,图片按钮,单选按钮以及复选框组件,今天所学的组件的方法及属性与之前的组件大部分相同。 1. 文本框组件 TextView 文本框组件就是最常见的文本内容,其中文本框的内容,推荐使用字符串资源定义, 位置在res-->values-->stri ...
分类:
其他好文 时间:
2020-02-05 20:29:10
阅读次数:
87
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s ...
分类:
其他好文 时间:
2020-02-05 17:58:35
阅读次数:
87
CF 616 div1 A 题解 若 $k \geq m 1$ ,我们可以任意指定顺序,我们求每个方案的最大值即可。 若 $k include include include define ll long long using namespace std; int read() { int k=0, ...
分类:
其他好文 时间:
2020-02-05 16:41:34
阅读次数:
57
1.BeautifulSoup简介 BeautifulSoup4和 lxml 一样,Beautiful Soup 也是一个HTML/XML的解析器,主要的功能也是如何解析和提取 HTML/XML 数据。 BeautifulSoup支持Python标准库中的HTML解析器,还支持一些第三方的解析器,如 ...
分类:
编程语言 时间:
2020-02-05 16:38:41
阅读次数:
109
Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer ...
分类:
其他好文 时间:
2020-02-05 13:42:39
阅读次数:
59
1、在无代码的情况下运行jsp出现404界面 The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. ...
分类:
其他好文 时间:
2020-02-05 13:16:49
阅读次数:
69