摘要: DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares. Regrettably, some of the squares are infertile and can't be planted. Canny FJ knows that the cows 阅读全文
posted @ 2012-03-30 21:51 'wind 阅读(343) 评论(0) 推荐(0) 编辑
摘要: Problem Description小t非常感谢大家帮忙解决了他的上一个问题。然而病毒侵袭持续中。在小t的不懈努力下,他发现了网路中的“万恶之源”。这是一个庞大的病毒网站,他有着好多好多的病毒,但是这个网站包含的病毒很奇怪,这些病毒的特征码很短,而且只包含“英文大写字符”。当然小t好想好想为民除害,但是小t从来不打没有准备的战争。知己知彼,百战不殆,小t首先要做的是知道这个病毒网站特征:包含多少不同的病毒,每种病毒出现了多少次。大家能再帮帮他吗?Input第一行,一个整数N(1<=N<=1000),表示病毒特征码的个数。接下来N行,每行表示一个病毒特征码,特征码字符串长度在1—5 阅读全文
posted @ 2012-03-30 19:05 'wind 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionHow can anagrams result from sequences of stack operations? There are two sequences of stack operators which can convert TROT to TORT: [i i i i o o o oi o i i o o i o]where i stands for Push and o stands for Pop. Your program should, given pairs of words produce sequences of stack 阅读全文
posted @ 2012-03-30 17:30 'wind 阅读(206) 评论(0) 推荐(0) 编辑