原创 ural 1297(求最長迴文子串,後綴數組)
1297. Palindrome Time Limit: 1.0 secondMemory Limit: 16 MB The “U.S. Robots” HQ has just received a rather alarming
原创 PKU 3261(求最長的至少出現k次的子串,後綴數組+二分枚舉)
Milk Patterns Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 3806 Accepted: 1569 Case Time Limit: 2000
原创 HDU 2454(2008哈爾濱現場賽)
Degree Sequence of Graph G Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Sub
原创 HQL函數彙總
Criteria查詢對查詢條件進行了面向對象封裝,符合編程人員的思維方式,不過HQL(Hibernate Query Language)查詢提供了更加豐富的和靈活的查詢特性,因此Hibernate將HQL查詢方式立爲官方推薦的標準查詢方式
原创 樹狀數組
樹狀數組是一個查詢(某一區間元素和)和修改(某一元素值),時間複雜度都爲log(n)的數據結構(普通數組查詢和修改的複雜度分別爲O(n)和O(1),當數據量非常大時,且需要頻繁求和,樹狀數組就能凸顯其高效性),假設數組a[1...n],
原创 PKU 2774(後綴數組求最長公共子串)
Long Long Message Time Limit: 4000MS Memory Limit: 131072K Total Submissions: 9500 Accepted: 3816 Case Time Limit:
原创 PKU 2250(變形的LCS)
Compromise Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2991 Accepted: 1407 Special Judge Descrip
原创 SPOJ 705(後綴數組求單個子串的不重複子串個數)
SPOJ Problem Set (classical) 705. New Distinct Substrings Problem code: SUBST1 Given a string, we need to find the
原创 HDU 1761(模擬題,字典樹)
Spring-outing Decision(2) Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Sub
原创 最長公共子序列【線段樹版的LCS】
#include<iostream> #include<cstring> #include<algorithm> #include<vector> #define N 200008 #define M using namespace s
原创 SPOJ 694(後綴數組)
694. Distinct Substrings Problem code: DISUBSTR Given a string, we need to find the total number of its distinct su
原创 樹狀數組【模板】
int lowbit(int t) { return t&(-t); } void change(int pos , int num,int n) //修改 { while (pos<=n) {
原创 後綴數組【模板】
//【倍增法模板】: int wa[maxn],wb[maxn],wv[maxn],ws[maxn]; int cmp(int *r,int a,int b,int l) {return r[a]==r[b]&&r[a+l]==r[b+
原创 最長重複子串(後綴數組)
http://ds.bianchengla.com/course/3/practise/problem?id=1387 最長重複子串 時間限制:1000 ms | 內存限制:3000 KB 描述 對於一個字符串S1,其中S2是
原创 PKU 2406(KMP算法的靈活應用)
Power Strings Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 13798 Accepted: 5754 Description Given t