上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
  2012年8月13日
摘要: DescriptionThe only printer in the computer science students' union is experiencing an extremely heavy workload. Sometimes there are a hundred jobs in the printer queue and you may have to wait for hours to get a single page of output.Because some jobs are more important than others, the Hacker 阅读全文
posted @ 2012-08-13 19:00 crying_Dream 阅读(938) 评论(0) 推荐(0)
摘要: Problem DescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This should be one piece of one pie, not several sm 阅读全文
posted @ 2012-08-13 10:39 crying_Dream 阅读(179) 评论(0) 推荐(0)
摘要: Problem DescriptionThe annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires the frog athletes to jump over the river. The width of the river is L (1<= L <= 1000000000). There are n 阅读全文
posted @ 2012-08-13 10:33 crying_Dream 阅读(337) 评论(0) 推荐(0)
摘要: DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that he will need to spend each day over the next N (1 ≤ N ≤ 100,000) days.FJ wants to create a 阅读全文
posted @ 2012-08-13 10:24 crying_Dream 阅读(931) 评论(0) 推荐(0)
摘要: DescriptionA prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "carbo", and "carbon". Note that the empty string is not considered a prefix in 阅读全文
posted @ 2012-08-13 10:11 crying_Dream 阅读(380) 评论(0) 推荐(0)
摘要: 字典树:也是trie树,根节点不包含字符,除了根节点外每个节点包含一个字符,而且都不一样。从根结点单到某结点的连线就是所对应的字符串。可以查找,插入和删除。实现过程:从根节点开始,查找第一个单词,找到后再找相应的子树进行循环这个过程...模板如下:struct node{ int cnt; //记录该字符出现次数 node *next[27];}*root; //root根节点 void Maketree(char *str) /*插入*/{ int ans, i, len; node *p, *q; p=root; len=strl... 阅读全文
posted @ 2012-08-13 10:08 crying_Dream 阅读(193) 评论(0) 推荐(0)
  2012年8月11日
摘要: DescriptionFor the daily milking, Farmer John'sNcows (1 ≤N≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things simple, he will take a contiguous range of cows from the milking lineup to play the game. 阅读全文
posted @ 2012-08-11 17:58 crying_Dream 阅读(167) 评论(0) 推荐(0)
摘要: DescriptionSome of Farmer John'sNcows (1 ≤N≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can see the top of other cows' heads.Each cowihas a specified heighthi(1 ≤hi≤ 1,000,000,000) and is stan 阅读全文
posted @ 2012-08-11 15:21 crying_Dream 阅读(493) 评论(0) 推荐(0)
摘要: DescriptionAn array of sizen≤ 106is given to you. There is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbers in the window. Each time the sliding window moves rightwards by one position. Following is an example:The array is[13-1- 阅读全文
posted @ 2012-08-11 11:02 crying_Dream 阅读(160) 评论(0) 推荐(0)
摘要: Description输入一个长度为n的整数序列(A1,A2,……,An),从中找出一段连续的长度不超过m的子序列,使得这个子序列的和最大。Input有多组测试数据,不超过20组测试数据。对于每组测试的第一行,包含两个整数n和m(n,m<=10^5),表示有n个数,子序列长度限制为m,表示这个序列的长度,第二行为n个数,每个数的范围为[-1000, 1000]。Output对于每组测试数据,输出最大的子序列和,并换行。Sample Input3 11 2 33 2-1000 1000 1Sample Output31001思路:看的比较懂得参考资料:http://blog.csdn.ne 阅读全文
posted @ 2012-08-11 10:58 crying_Dream 阅读(341) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页