摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4158Problem DescriptionIn the game of Go, two players alternate placing black and white stones on lattice points of an n × n grid, each attempting to surround as much territory (i.e., regions of unfilled lattice points) as possible. At the end of the ga 阅读全文
摘要:
Problem DescriptionWhen you go shopping, you can search in repository for avalible merchandises by the computers and internet. First you give the search system a name about something, then the system responds with the results. Now you are given a lot merchandise names in repository and some queries, 阅读全文
摘要:
http://poj.org/problem?id=2001http://acm.hnu.cn/online/?action=problem&type=show&id=10338ShortestPrefixesTime Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KBTotal submit users: 50, Accepted users: 48Problem 10338 : No special judgementProblem descriptionA prefix of a string is 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1247Problem DescriptionA hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.You are to find all the hat’s words in a dictionary.InputStandard input consists of a number of lowercase words, one per li 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1671Problem DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:1. Emergency 9112. Alice 97 625 9993. Bob 91 12 54 26In this case, it 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1251Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串.注意:本题只有一组测试数据,处理到文件结束.Output对于每个提问,给出以该字符串为 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1114Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple. Whenever some ACM member has any 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2191Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一个未知数。那么,我们要做的就应该是珍惜现在,感恩生活——感谢父母,他们给予我们生命,抚养我们成人;感 阅读全文
摘要:
各个容器有很多的相似性。先学好一个,其它的就好办了。先从基础开始。先看看他们的分类吧标准STL序列容器:vector、string、deque和list。标准STL关联容器:set、multiset、map和multimap。非标准序列容器slist和rope。slist是一个单向链表,rope本质上是一个重型字符串。非标准关联容器hash_set、hash_multiset、hash_map和hash_multimap。(各容器成员对比见:【STL】各容器成员对比表)先看看list。listSTL中的list就是一双向链表,可高效地进行插入删除元素。list不支持随机访问。所以没有 at(p 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2540Problem Description在一个广场上有一排沿着东西方向排列的石柱子,阳光从东边以一定的倾角射来(平行光)。有的柱子可能被在他东边的高大的柱子的影子给完全遮挡住了。现在你要解决的问题是求出有多少柱子是没有被完全遮挡住的。假设每个石柱子是一根细棒,而且都垂直于地面摆放。Input输入包含多组数据。每组数据第一行是一个整数N(0<N<=100000),表示柱子的个数。N=0代表输入结束。接下来有N行,每行是两个整数,分别给出每根柱子的水平位置X和高度H(X越大,表示越在西边,0< 阅读全文