摘要:
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)
浙公网安备 33010602011771号