上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页
摘要: DescriptionProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many computer systems. This problem requires that you write a program to compute the exact value of Rn where .. 阅读全文
posted @ 2013-05-17 11:08 forevermemory 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Problem Description Mr. West bought a new car! So he is travelling around the city.One day he comes to a vertical corner. The street he is currently in has a width x, the street he wants to turn to has a width y. The car has a length l and a width d.Can Mr. West go across the corner? Input Every l.. 阅读全文
posted @ 2013-05-16 19:31 forevermemory 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires the frog athletes to jump over the river. The width of the river is L (1<= L <= 1000000000). There are n 阅读全文
posted @ 2013-05-16 16:23 forevermemory 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionSick and tired of pushing paper in the dreary bleary-eyed world of finance, Flo ditched her desk job and built her own restaurant.In the small restaurant, there are several two-seat tables, four-seat tables and six-seat tables. A single diner or a group of two diners should be a.. 阅读全文
posted @ 2013-05-14 12:29 forevermemory 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Problem 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 small money, he takes all the coins and throws 阅读全文
posted @ 2013-05-13 23:01 forevermemory 阅读(123) 评论(0) 推荐(0) 编辑
摘要: P01: 01背包问题 这是最基本的背包问题,每个物品最多只能放一次题目有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。基本思路这是最基础的背包问题,特点是:每种物品仅有一件,可以选择放或不放。用子问题定义状态:即f[i][v]表示前i件物品恰放入一个容量为v的背包可以获得的最大价值。则其状态转移方程便是:f[i][v]=max{f[i-1][v],f[i-1][v-c[i]]+w[i]}。这个方程非常重要,基本上所有跟背包相关的问题的方程都是由它衍生出来的。所以有必要将它详细解释一下:“将 阅读全文
posted @ 2013-05-13 15:59 forevermemory 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave … The bone collector had a big bag with a volume of V ,and along his trip of collecting there are a lo 阅读全文
posted @ 2013-05-13 11:56 forevermemory 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Description: 将数列1.2,3,……,n*n,依次按蛇形方式存在二维数组A[1..n,1..n]中。Input:输入有多组数据,每组数据为一个整数n,( 0< n < 30 )以EOF结束。Output:按照样例格式打印出每组蛇形数,每个数据占有四个域宽,两个数据之间没有空格隔开。两组数据之间有一个换行。Sample Input:145Sample Output: 1 1 2 6 7 3 5 8 13 4 9 12 14 10 11 15 16 1 2 6 7 15 3 5 8 14 16 4... 阅读全文
posted @ 2013-05-07 10:45 forevermemory 阅读(360) 评论(0) 推荐(0) 编辑
摘要: Problem 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 911 2. Alice 97 625 999 3. Bob 91 12 54 26 In this case, it’s not possible to call Bob, because the c 阅读全文
posted @ 2013-05-05 13:20 forevermemory 阅读(503) 评论(0) 推荐(0) 编辑
摘要: DescriptionA Compiler Mystery: We are given a C-language style for loop of typefor (variable = A; variable != B; variable += C) statement;I.e., a loop which starts by setting variable to value A and while variable is not equal to B, repeats statement followed by increasing the variable by C. We wa.. 阅读全文
posted @ 2013-05-04 00:06 forevermemory 阅读(174) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页