摘要:
博客搬家啊。。。现以搬家到CSDN。。。。http://blog.csdn.net/ck_boss 阅读全文
摘要:
PeriodTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2258Accepted Submission(s): 1117Problem DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether 阅读全文
摘要:
Bracket SequenceTime Limit:3000MSMemory Limit:65536KB64bit IO Format:%lld & %llu[Submit] [Go Back] [Status]DescriptionThere is a sequence of brackets, which supports two kinds of operations.1. we can choose a interval [l,r], and set all the elements range in this interval to left br... 阅读全文
摘要:
A Simple Tree ProblemTime Limit:3 Seconds Memory Limit:65536 KBGiven a rooted tree, each node has a boolean (0 or 1) labeled on it. Initially, all the labels are 0.We define this kind of operation: given a subtree, negate all its labels.And we want to query the numbers of 1's of a subtree.InputM 阅读全文
摘要:
strcmp() Anyone?Time Limit:2000MSMemory Limit:Unknown64bit IO Format:%lld & %llu[Submit] [Go Back] [Status]DescriptionJ“strcmp()” Anyone?Input:Standard InputOutput:Standard Outputstrcmp() is a library function in C/C++ which compares two strings. It takes two strings as input parameter and decid 阅读全文
摘要:
一般写的字典树都是双数组的形式,但是当字符的数量很多时,就会占用大量的内存,初始化操作也会变慢。这时,就可以用左孩子右兄弟的写法,来以时间换空间。下面是自己写的一个: 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 const int maxnode=100000; 8 9 struct Trie10 {11 char ch[maxnode];12 int left[maxnode],right[maxnode],cnt;13 bool flag[maxnode];14 15 ... 阅读全文
摘要:
字典树优化DP Remember the WordTime Limit:3000MSMemory Limit:Unknown64bit IO Format:%lld & %llu[Submit] [Go Back] [Status]DescriptionNeal is very curious about combinatorial problems, and now here comes a problem about words. Knowing that Ray has a photographic memory and this may not troubl... 阅读全文
摘要:
状压+暴力搜索Lights Against DudelyTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 178Accepted Submission(s): 57Problem DescriptionHarry: "But Hagrid. How am I going to pay for all of this? I haven't any money."Hagrid: "Well there's 阅读全文
摘要:
"Ray, Pass me the dishes!"Time Limit:3000MSMemory Limit:Unknown64bit IO Format:%lld & %llu[Submit] [Go Back] [Status]DescriptionAfter doing Ray a great favor to collect sticks for Ray, Poor Neal becomes very hungry. In return for Neal's help, Ray makes a great dinner for Neal. When 阅读全文
摘要:
2007/2008 ACM International Collegiate Programming ContestUniversity of Ulm Local ContestProblem F: Frequent valuesYou are given a sequence ofnintegersa1, a2, ... , anin non-decreasing order. In addition to that, you are given several queries consisting of indicesiandj(1 ≤ i ≤ j ≤ n). For each query 阅读全文