摘要: 一只木桶能盛多少水,并不取决于桶壁上最高的那块木板,而恰恰取决于桶壁上最短的那块。 已知一个木桶的桶壁由N块木板组成,第i块木板的长度为Ai。 现在小Hi有一个快捷修补工具,每次可以使用修补工具将连续的不超过L块木板提高至任意高度。 已知修补工具一共可以使用M次(M*L<N),如何修补才能使最短的那 阅读全文
posted @ 2019-07-26 14:20 GRedComeT 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi 阅读全文
posted @ 2019-07-26 12:42 GRedComeT 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100; Now please try your lucky. InputThe first lin 阅读全文
posted @ 2019-07-25 15:03 GRedComeT 阅读(95) 评论(0) 推荐(0) 编辑
摘要: The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D 阅读全文
posted @ 2019-07-25 15:01 GRedComeT 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Alice and Bob's game never ends. Today, they introduce a new game. In this game, both of them have N different rectangular cards respectively. Alice w 阅读全文
posted @ 2019-07-24 23:27 GRedComeT 阅读(108) 评论(0) 推荐(0) 编辑
摘要: You can perfectly predict the price of a certain stock for the next N days. You would like to profit on this knowledge, but only want to transact one 阅读全文
posted @ 2019-07-24 20:56 GRedComeT 阅读(105) 评论(0) 推荐(0) 编辑
摘要: As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a 阅读全文
posted @ 2019-07-24 17:54 GRedComeT 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Farmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cows eating the grass, as usual. When he returned, he found to his horror that the clus 阅读全文
posted @ 2019-07-24 16:53 GRedComeT 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea 阅读全文
posted @ 2019-07-24 16:24 GRedComeT 阅读(131) 评论(0) 推荐(0) 编辑
摘要: You are given a rooted tree with n vertices. The vertices are numbered from 1 to n, the root is the vertex number 1. Each vertex has a color, let's de 阅读全文
posted @ 2019-07-24 15:16 GRedComeT 阅读(138) 评论(0) 推荐(0) 编辑