摘要: 705. New Distinct SubstringsProblem code: SUBST1Given a string, we need to find the total number of its distinct substrings.InputT- number of test cases. T 2 #include 3 #include 4 using namespace std; 5 #define N 51000 6 char a[N]; 7 int c[N],d[N],e[N],sa[N],height[N],n,b[N],m; 8 int cmp(int *r,in.. 阅读全文
posted @ 2014-03-11 23:55 ERKE 阅读(239) 评论(0) 推荐(0) 编辑
摘要: Milk PatternsTime Limit:5000MSMemory Limit:65536KTotal Submissions:9274Accepted:4173Case Time Limit:2000MSDescriptionFarmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although he can't predict the quality of mi 阅读全文
posted @ 2014-03-11 13:57 ERKE 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Musical ThemeTime Limit:1000MSMemory Limit:30000KTotal Submissions:16757Accepted:5739DescriptionA musical melody is represented as a sequence of N (1 2 #include 3 #include 4 using namespace std; 5 #define N 20001 6 int a[N],c[N],d[N],e[N],sa[N],height[N],n,b[N],m; 7 int cmp(int *r,int a,int b,int .. 阅读全文
posted @ 2014-03-11 13:50 ERKE 阅读(219) 评论(0) 推荐(0) 编辑