摘要:
reverse 方法很好用时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueGiven a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given... 阅读全文
posted @ 2015-12-06 11:33
白夜行zz
阅读(228)
评论(0)
推荐(0)
摘要:
Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9]"."[0-9]+E[+-][0-9]+ which means that the in... 阅读全文
posted @ 2015-12-06 11:31
白夜行zz
阅读(149)
评论(0)
推荐(0)
摘要:
map的使用时间限制300 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者HOU, QimingPeople often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "th... 阅读全文
posted @ 2015-12-06 11:29
白夜行zz
阅读(175)
评论(0)
推荐(0)
摘要:
dij适合计算单源最短路径,计算一个源到各个点的距离比较快dfs不适合算每个点到每个点的距离,迭代次数太多、时间限制200 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA gas station has to be built at such a location that the minimum distance between the s... 阅读全文
posted @ 2015-12-06 11:29
白夜行zz
阅读(386)
评论(0)
推荐(0)
摘要:
(库存量也是double)时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueMooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be... 阅读全文
posted @ 2015-12-06 11:27
白夜行zz
阅读(168)
评论(0)
推荐(0)
摘要:
For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by takin... 阅读全文
posted @ 2015-12-06 11:26
白夜行zz
阅读(288)
评论(0)
推荐(0)
摘要:
Given any permutation of the numbers {0, 1, 2,..., N-1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2... 阅读全文
posted @ 2015-12-06 11:25
白夜行zz
阅读(176)
评论(0)
推荐(0)
摘要:
动态背包题意:给定一系列的硬币值, 然后给定一个目标value, 从所有硬币中找出几个, 使得这几个硬币的和正好等于这个value, 而且这个硬币序列应该是满足硬币值字典序的最小序列.分析:属于典型的背包问题. 用动态规划(dp)做, 假设F(N, M)表示不超过面值M, 而且从前面N个硬币中挑选硬币值能得到的最大硬币面值总和, 那我们可以得到如下递归公式:F(N, M) = max{ F(N–... 阅读全文
posted @ 2015-12-06 11:25
白夜行zz
阅读(196)
评论(0)
推荐(0)
摘要:
时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAn AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; i... 阅读全文
posted @ 2015-12-06 11:24
白夜行zz
阅读(184)
评论(0)
推荐(0)
摘要:
要输入字符串,longlongint不够时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者HOU, QimingGiven three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C.Input Specification:The first l... 阅读全文
posted @ 2015-12-06 11:22
白夜行zz
阅读(157)
评论(0)
推荐(0)