上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 53 下一页
摘要: Matrix Chain MultiplicationTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 1695Accepted: 1090DescriptionSuppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices.Since matrix multiplication is associative, the order in which multiplications are performed is 阅读全文
posted @ 2012-10-27 21:49 剑不飞 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Anagrams by StackTime Limit: 2 Seconds Memory Limit: 65536 KB How 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 o i o i i o o i o ] where i stands for Push and o stands for Pop. Your program should, g 阅读全文
posted @ 2012-10-27 21:15 剑不飞 阅读(210) 评论(0) 推荐(0) 编辑
摘要: StringsobitsKim Schrijvers Consider an ordered set S of strings of N (1 15说明4位装不下,不到19个那么第5位一定得是1, 即是1xxxx(x代表未知)假设m为输入的I,m原先等于19,当第5位确定为1后m=m-15=4;那原题转化为求42 4的输出只要求出4 2 4的输出,也就是求1xxxx 后面的四个x;同样的3位可选2个1,1个1,0个1 有7>4;也就是说3位可以装的下那第四位就为0,原题转化为求3, 2 4的输出即是求10XXX后面的三个未知数,重复操作 直到m化为0,得到结果。注意点:31位,貌似int 阅读全文
posted @ 2012-10-24 16:58 剑不飞 阅读(239) 评论(0) 推荐(0) 编辑
摘要: FactorialsThe factorial of an integer N, written N!, is the product of all the integers from 1 through N inclusive. The factorial quickly becomes very large: 13! is too large to store in a 32-bit integer on most computers, and 70! is too large for most floating-point variables. Your task is to find 阅读全文
posted @ 2012-10-23 19:47 剑不飞 阅读(151) 评论(0) 推荐(0) 编辑
摘要: ContactIOI'98 The cows have developed a new interest in scanning the universe outside their farm with radiotelescopes. Recently, they noticed a very curious microwave pulsing emission sent right from the centre of the galaxy. They wish to know if the emission is transmitted by some extraterrestr 阅读全文
posted @ 2012-10-21 21:08 剑不飞 阅读(188) 评论(0) 推荐(0) 编辑
摘要: StampsGiven a set of N stamp values (e.g., {1 cent, 3 cents}) and an upper limit K to the number of stamps that can fit on an envelope, calculate the largest unbroken list of postages from 1 cent to M cents that can be created.For example, consider stamps whose values are limited to 1 cent and 3 cen 阅读全文
posted @ 2012-10-20 15:37 剑不飞 阅读(259) 评论(0) 推荐(0) 编辑
摘要: Shaping RegionsN opaque rectangles (1 #include using namespace std; ifstream cin("rect1.in"); ofstream cout("rect1.out"); const int mm=2600; class point { public: int l,r,u,d; int colour,area; point(){area=0;colour=0;} }pos[1200]; int ans[mm]; int cas; int ce; void kill(int l,int 阅读全文
posted @ 2012-10-20 13:34 剑不飞 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Humble NumbersFor a given set of K prime numbers S = {p1, p2, ..., pK}, consider the set of all numbers whose prime factors are a subset of S. This set contains, for example, p1, p1p2, p1p1, and p1p2p3 (among others). This is the set of `humble numbers' for the input set S. Note: The number 1 is 阅读全文
posted @ 2012-10-12 18:30 剑不飞 阅读(298) 评论(0) 推荐(0) 编辑
摘要: Score InflationThe more points students score in our contests, the happier we here at the USACO are. We try to design our contests so that people can score as many points as possible, and would like your assistance.We have several categories from which problems can be chosen, where a "category& 阅读全文
posted @ 2012-10-09 20:17 剑不飞 阅读(219) 评论(0) 推荐(0) 编辑
摘要: Agri-NetRuss Cox Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.Farmer John ordered a high speed connection for his farm and is going to share his connectivity with the other farm 阅读全文
posted @ 2012-10-08 21:10 剑不飞 阅读(170) 评论(0) 推荐(0) 编辑
上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 53 下一页