Given many words, words[i] has weight i. Design a class WordFilter that supports one function, WordFilter.f(String prefix, String suffix). It will return the word with given prefix and suffix with maximum weight. If no word exists, return -1. Example
Long Long Message Time Limit: 4000MS Memory Limit: 131072K Total Submissions: 29277 Accepted: 11887 Case Time Limit: 1000MS Description The little cat is majoring in physics in the capital of Byterland. A piece of sad news comes to him these days
Maximum repetition substring Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9458 Accepted: 2915 Description The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same conse
Musical Theme Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 27539 Accepted: 9290 Description A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the
http://uoj.ac/problem/35 以前做后缀数组的题直接粘模板...现在重新写一下模板 注意用来基数排序的数组一定要开到N. #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N = 100003; int t1[N], t2[N], c[N]; void st(int *x, int *y, int *sa, int n, int