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 ...
分类:
其他好文 时间:
2019-04-02 12:38:18
阅读次数:
277
分析: 思路有,但是一开始不确认正不正确,但是举的例子告诉我这样想目前是对的,于是就写了。 值的注意的是,while(max_num<len-2 && prices[max_num]<prices[max_num+1]),这句话里以后一定要先把值的边界性判断放前面,不然max_num+1超出边界,会 ...
分类:
其他好文 时间:
2019-04-02 12:24:38
阅读次数:
142
#include using namespace std; #define maxSize 60 int main() { int score[maxSize]; int n, k, res; cin>>n>>k; res=0; for(int i=0; i>score[i]; for(int i=... ...
分类:
其他好文 时间:
2019-04-02 09:21:49
阅读次数:
165
简单分页(查看第n页,每页显示n条) 使用方法: 1.导入PageNumberPagination类; 2.实例化产生一个对象:page_pagination = PageNumberPagination(); 3.需要配置四个参数:page_size,page_query_param,page_s ...
分类:
其他好文 时间:
2019-04-01 18:44:28
阅读次数:
203
版本一:datafile1.go:packagev1import("errors""io""os""sync")//Data代表数据的类型。typeData[]byte//DataFile代表数据文件的接口类型。typeDataFileinterface{//Read会读取一个数据块。Read()(rsnint64,dData,errerror)//Write会写入一个数据块。Write(dDat
分类:
其他好文 时间:
2019-04-01 17:24:05
阅读次数:
112
CSL 的字符串 题解: 从前往后扫一遍 如果当前这个字符本身就是到当前为止第一次出现的,那肯定要留下它吧,就把它放到ans数组里面,并且把这个字母的个数减一(最开始统计的每个字母出现的个数相当于每个字母的剩余个数)然后从这个字母开始遍历ans数组中该字母前面的所有字母 ,如果前面的字母的字典序大于 ...
分类:
其他好文 时间:
2019-04-01 17:17:30
阅读次数:
216
The solution for the problem can be divided into three cases: case 1: if the delete node is leaf node, then we can simply remove it case 2: if the del ...
分类:
其他好文 时间:
2019-04-01 17:13:38
阅读次数:
105
第一种 <keep-alive> <router-view v-if="$route.meta.keepAlive"></router-view> </keep-alive> <router-view v-if="!$route.meta.keepAlive"></router-view> 配合路由 ...
分类:
其他好文 时间:
2019-04-01 15:46:36
阅读次数:
342
Two Merged Sequences 感觉是个垃圾题啊, 为什么过的人这么少。。 dp[ i ][ 0 ]表示处理完前 i 个, 第 i 个是递增序列序列里的元素,递减序列的最大值。 dp[ i ][ 1 ]表示处理完前 i 个, 第 i 个是递减序列序列里的元素,递增序列的最大值。 然后随便转 ...
分类:
其他好文 时间:
2019-04-01 01:12:16
阅读次数:
136