题目传送门 1 /* 2 LIS:应用,nlogn的做法,首先从前扫到尾,记录每个位置的最长上升子序列,从后扫到头同理。 3 因为是对称的,所以取较小值*2-1再取最大值 4 */ 5 /****************************************...
分类:
其他好文 时间:
2015-08-06 00:10:49
阅读次数:
120
K-queryGiven a sequence of n numbers a1, a2, ..., anand a number of k- queries. A k-query is a triple (i, j, k) (1 ≤ i ≤...
分类:
其他好文 时间:
2015-08-06 00:00:54
阅读次数:
327
题目传送门 1 /* 2 Rabin_Karp:虽说用KMP更好,但是RK算法好理解。简单说一下RK算法的原理:首先把模式串的哈希值算出来, 3 在文本串里不断更新模式串的长度的哈希值,若相等,则找到了,否则整个模式串的长度的哈希值向右移动一位 4 */ 5 /*********...
分类:
其他好文 时间:
2015-08-05 17:39:59
阅读次数:
100
Description:In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping...
分类:
编程语言 时间:
2015-08-05 08:54:01
阅读次数:
159
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5288 1 //*************头文件区************* 2 #include 3 #include 4 #include 5 #define N 100010 6 #define P...
分类:
其他好文 时间:
2015-08-05 06:25:53
阅读次数:
137
Divisibility
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 11001
Accepted: 3933
Description
Consider an arbitrary sequence of integers. One can place +...
分类:
其他好文 时间:
2015-08-05 01:10:57
阅读次数:
106
原文地址——http://blog.csdn.net/qq525099302/article/details/47280211
user_sequences中保存着当前用户的所有序列信息,可以从这张系统内置表中查询当前序列值select seq.last_number from user_sequences seq where seq.sequence_name='SEQ_B_ORDER_ID';...
分类:
其他好文 时间:
2015-08-04 19:17:44
阅读次数:
110
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
For example, given
s = "leetcode",
dict = ["leet"...
分类:
其他好文 时间:
2015-08-04 17:13:03
阅读次数:
111
问题描述Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,Given [100, 4, 200, 1, 3, 2],The lo...
分类:
其他好文 时间:
2015-08-04 12:46:55
阅读次数:
115
Farey Sequence
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 13204
Accepted: 5181
Description
The Farey Sequence Fn for any integer n with n >= 2 is the...
分类:
其他好文 时间:
2015-08-04 11:24:36
阅读次数:
108