上一页 1 ··· 14 15 16 17 18
摘要: DescriptionYou want to arrange the window of your flower shop in a most pleasant way. You have F bunches of flowers, each being of a different kind, and at least as many vases ordered in a row. The vases are glued onto the shelf and are numbered consecutively 1 through V, where V is the number of va 阅读全文
posted @ 2011-08-14 12:34 追逐. 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Description 73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that starts at the top and ends somewhere on the base. Each step can go either diagonally down to the left or diagonally down to the right. In 阅读全文
posted @ 2011-08-14 12:33 追逐. 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 题意: 给定三个字符串,判断前两个经过字符顺序不变的组合能否变为第三个字符串。 用bool型数组dp[i][j]记录str1的前i个字符和str2的前j个字符能否组合成str3的前i+j个字符。str3的最后一个字符肯定是 str1或str2的最后一个字符,想得到dp[i][j],则必须知道dp[i-1][j](即str1的前i-1个字符和str2的前j个字符能否组合成str3的前i-1+j个字符)和dp[i][j-1](即str1的前i个字符和str2的前j-1个字符能否组合成str3的前i+j-1个字符),由此将问题分解为str1的前n个字符和str2的前m个字符能否组合成str3... 阅读全文
posted @ 2011-08-14 12:33 追逐. 阅读(199) 评论(0) 推荐(0) 编辑
摘要: A military contractor for the Department of Defense has just completed a series of preliminary tests for a new defensive missile called the CATCHER which is capable of intercepting multiple incoming offensive missiles. The CATCHER is supposed to be a remarkable defensive missile. It can move forwar. 阅读全文
posted @ 2011-08-14 12:27 追逐. 阅读(907) 评论(0) 推荐(0) 编辑
摘要: 题意: N个人减肥,给出他们的起始体重和减肥的天数,而且每天能减去一磅的体重。要求按减肥者减肥过后的体重降序排列姓名。 输入:姓名 减肥天数 起始体重 输出:降序输出姓名 此题原想用C++写,但因不太了解C++字符串操作的基本方法(strcmp()),无法实现部分功能,所以改用JAVA。创建一个类存放减肥者的信息(姓名,减肥后的体重),根据计算得出的weight对对象数组排序。要注意要求每组数据输出后保留一行空格。 代码: import java.util.* ; class People{ String name ;int weigth ;} public class Main{ publi 阅读全文
posted @ 2011-08-14 12:19 追逐. 阅读(298) 评论(0) 推荐(0) 编辑
摘要: DescriptionThere is a huge mountain outside Kicc's house, and Kicc has to climb the mountain every time he wants to go out. It costs him a lot of time and he wants to change the situation. Yes, he figures out a good idea - to move the mountain away! But there is a problem. There are some wild an 阅读全文
posted @ 2011-08-14 12:17 追逐. 阅读(331) 评论(0) 推荐(0) 编辑
摘要: Description A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the minimal number of characters to be inserted into the string in order to obtain a palindrome. As an e 阅读全文
posted @ 2011-08-11 21:58 追逐. 阅读(237) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18