上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页
摘要: Barn RepairIt was a dark and stormy night that ripped the roof and gates off the stalls that hold Farmer John's cows. Happily, many of the cows were on vacation, so the barn was not completely full.The cows spend the night in stalls that are arranged adjacent to each other in a long line. Some s 阅读全文
posted @ 2012-10-10 21:31 jiangzh 阅读(307) 评论(0) 推荐(0)
摘要: Mixing MilkSince milk packaging is such a low margin business, it is important to keep the price of the raw product (milk) as low as possible. Help Merry Milk Makers get the milk they need in the cheapest possible manner.The Merry Milk Makers company has several farmers from which they may buy milk, 阅读全文
posted @ 2012-10-10 21:07 jiangzh 阅读(302) 评论(0) 推荐(0)
摘要: 关押罪犯 prison题目描述S 城现有两座监狱,一共关押着N 名罪犯,编号分别为1~N。他们之间的关系自然也极不和谐。很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突。我们用“怨气值”(一个正整数值)来表示某两名罪犯之间的仇恨程度,怨气值越大,则这两名罪犯之间的积怨越多。如果两名怨气值为c 的罪犯被关押在同一监狱,他们俩之间会发生摩擦,并造成影响力为c 的冲突事件。每年年末,警察局会将本年内监狱中的所有冲突事件按影响力从大到小排成一个列表,然后上报到S 城Z 市长那里。公务繁忙的Z 市长只会去看列表中的第一个事件的影响力,如果影响很坏,他就会考虑撤换警察局长。在详细考察了N 名罪 阅读全文
posted @ 2012-10-10 20:43 jiangzh 阅读(398) 评论(0) 推荐(0)
摘要: 乌龟棋tortoise题目描述小明过生日的时候,爸爸送给他一副乌龟棋当作礼物。乌龟棋的棋盘是一行N 个格子,每个格子上一个分数(非负整数)。棋盘第1 格是唯一的起点,第N 格是终点,游戏要求玩家控制一个乌龟棋子从起点出发走到终点。……12345……N输入格式输入文件的每行中两个数之间用一个空格隔开。第1 行2 个正整数N 和M,分别表示棋盘格子数和爬行卡片数。第2 行N 个非负整数,a1, a2, ……, aN,其中ai 表示棋盘第i 个格子上的分数。第3 行M 个整数,b1,b2, ……, bM,表示M 张爬行卡片上的数字。输入数据保证到达终点时刚好用光M 张爬行卡片,即N−;;1=Σb_i 阅读全文
posted @ 2012-10-10 20:31 jiangzh 阅读(360) 评论(0) 推荐(0)
摘要: 机器翻译translate题目描述小晨的电脑上安装了一个机器翻译软件,他经常用这个软件来翻译英语文章。这个翻译软件的原理很简单,它只是从头到尾,依次将每个英文单词用对应的中文含义来替换。对于每个英文单词,软件会先在内存中查找这个单词的中文含义,如果内存中有,软件就会用它进行翻译;如果内存中没有,软件就会在外存中的词典内查找,查出单词的中文含义然后翻译,并将这个单词和译义放入内存,以备后续的查找和翻译。假设内存中有M 个单元,每单元能存放一个单词和译义。每当软件将一个新单词存入内存前,如果当前内存中已存入的单词数不超过M−;;1,软件会将新单词存入一个未使用的内存单元;若内存中已存入M 个单词, 阅读全文
posted @ 2012-10-10 20:20 jiangzh 阅读(516) 评论(0) 推荐(0)
摘要: Palindromic SquaresRob Kolstad Palindromes are numbers that read the same forwards as backwards. The number 12321 is a typical palindrome.Given a number base B (2 <= B <= 20 base 10), print all the integers N (1 <= N <= 300 base 10) such that the square of N is palindromic when expressed 阅读全文
posted @ 2012-10-07 12:30 jiangzh 阅读(453) 评论(0) 推荐(0)
摘要: Name That NumberAmong the large Wisconsin cattle ranchers, it is customary to brand cows with serial numbers to please the Accounting Department. The cow hands don't appreciate the advantage of this filing system, though, and wish to call the members of their herd by a pleasing name rather than 阅读全文
posted @ 2012-10-07 12:04 jiangzh 阅读(234) 评论(0) 推荐(0)
摘要: TransformationsA square pattern of size N x N (1 <= N <= 10) black and white square tiles is transformed into another square pattern. Write a program that will recognize the minimum transformation that has been applied to the original pattern given the following list of possible transformation 阅读全文
posted @ 2012-10-06 18:41 jiangzh 阅读(353) 评论(0) 推荐(0)
摘要: Milking Cows 挤牛奶(milk2)Milking CowsThree farmers rise at 5 am each morning and head for the barn to milk three cows. The first farmer begins milking his cow at time 300 (measured in seconds after 5 am) and ends at time 1000. The second farmer begins at time 700 and ends at time 1200. The third farme 阅读全文
posted @ 2012-10-06 15:31 jiangzh 阅读(422) 评论(0) 推荐(0)
摘要: 题目:过河卒 rqnoj69题目描述 如图,A 点有一个过河卒,需要走到目标 B 点。卒行走规则:可以向下、或者向右。同时在棋盘上的任一点有一个对方的马(如上图的C点),该马所在的点和所有跳跃一步可达的点称为对方马的控制点。例如上图 C 点上的马可以控制 9 个点(图中的P1,P2 … P8 和 C)。卒不能通过对方马的控制点。 棋盘用坐标表示,A 点(0,0)、B 点(n,m)(n,m 为不超过 25 的整数,并由键盘输入),同样马的位置坐标是需要给出的(约定: C<>A,同时C<>B)。现在要求你计算出卒从 A 点能够到达 B 点的路径的条数。输入格式键盘输入 B点 阅读全文
posted @ 2012-10-05 17:42 jiangzh 阅读(431) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页