关注的人麻烦帮忙解释一下,主要是
The Price is Wrong
Random Route
Egg Drop
这3道题目,codejam上有题目.发下题目吧,
The Price is Wrong
ProblemYou're playing a game in which you try to guess the correct retail price of various products for sale. After guessing the price of each product in a list, you are shown the same list of products sorted by their actual prices, from least to most expensive. (No two products cost the same amount.) Based on this ordering, you are given a single chance to change one or more of your guesses.Your program should output the smallest set of products such that, if you change your prices for those products, the ordering of your guesses will be consistent with the correct ordering of the product list. The products in the returned set should be listed in alphabetical order. If there are multiple smallest sets, output the set which occurs first lexicographically.For example, assume these are your initial guesses:code = $20
jam = $15
foo = $40
bar = $30
google = $60
If the correct ordering is code jam foo bar google, then you would need to change two of your prices in order to match the correct ordering. You might change one guess to read jam = $30 and another guess to read bar = $50, which would match the correct ordering and produce the output set bar jam. However, the output set bar code comes before bar jam lexicographically, and you can match the correct ordering by changing your guesses for these items as well.InputThe first line of input gives the number of cases, N. N test cases follow. Each case consists of two lines. The first line contains the list of products, space separated, sorted from least to most expensive. Each product's name will consist of only lowercase letters and underscores. There will be no duplicate products in the list. The second line contains your initial guesses for each product in the list, respectively. All guesses will be integers between 1 and 100, inclusive. The number of guesses will be equal to the number of products, and no two guesses will be the same. The guesses will be space separated. (Note that although the initial guesses all happen to be integers, you are allowed to change your guesses to any amounts, not just integers.)OutputFor each test case, output one line containing "Case #x: " followed by the set of products for which you must change your prices. The products should be in alphabetical order and space separated. The constraints guarantee that you will need to change the price of at least one product for each test case.Limits1 ≤ N ≤ 100. Small dataset2 ≤ number of products in list ≤ 8
Large dataset2 ≤ number of products in list ≤ 64
Sample
Input
 1
code jam foo bar google
20 15 40 30 60Output Case #1: bar code太大了,应该有人了解的吧,麻烦解释下,或者去google去看看.....just for fun!!!希望有人帮忙!!
 

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【wunaixiwunai】截止到2008-06-28 00:19:48的历史汇总数据(不包括此帖):
    发帖数:4                  发帖分:210                
    结贴数:2                  结贴分:110                
    未结数:2                  未结分:100                
    结贴率:50.00 %            结分率:52.38 %            
    楼主加油
      

  2.   

    意思是说改最少的产品价钱的个数,来达到价钱从小到大的顺序。
    如果出现同样个数,则以字母顺序最小的为结果code jam foo bar google
    20 15 40 30 60 可以改 code =5 , bar = 50
    也可以改 jam  = 30, bar =55
    改的数字无关,只在定量级的。介jam 比code在字典中比较后,所以结果是 bar,codehttp://blog.microtemple.com