RMQ (Range Minimum/Maximum Query)问题是指:对于长度为n的数列A,回答若干询问RMQ(A,i,j)(i,j<=n),返回数列A中下标在i,j里的最小(大)值,也就是说,RMQ问题是指求区间最值的问题。...
分类:
其他好文 时间:
2015-07-25 21:37:41
阅读次数:
125
A - Maximum sum
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d
& %I64u
Submit Status Practice POJ
2479
Description
Given a set of n integers: A={a1, a2,..., a...
分类:
其他好文 时间:
2015-07-25 18:29:19
阅读次数:
165
Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a...
分类:
其他好文 时间:
2015-07-24 20:41:53
阅读次数:
82
I love developing software on my MacBook Air! I got the latest version with the maximum possible specifications (i7, 8GB internal mem, 512GBSSD disk) ...
分类:
系统相关 时间:
2015-07-24 12:31:18
阅读次数:
221
题目https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/
Say you have an array for which the ith element is the price of a
given stock on day i. Design an algorithm to find the maximum...
分类:
其他好文 时间:
2015-07-24 09:22:28
阅读次数:
125
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] has the...
分类:
其他好文 时间:
2015-07-22 20:58:27
阅读次数:
127
water~数据不大,枚举首尾即可,也不用高精度。代码如下:#includeint main() { int kase(0), n; while (scanf("%d", &n) == 1) { int s[20]; for (int i = 0; i != n; ++i) scanf("%d", ...
分类:
其他好文 时间:
2015-07-22 13:01:41
阅读次数:
127
GP数据库中表结构查询的方法:selectd.nspname,obj_description(d.oid),c.relname,obj_description(c.oid),a.attnum,a.attname,e.data_type,col_description(c.oid,a.attum),e.is_nullable,casewheree.data_type~‘character‘thene.character_maximum_length||‘‘wheree.data_typ..
分类:
数据库 时间:
2015-07-22 11:05:42
阅读次数:
174
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the...
分类:
其他好文 时间:
2015-07-21 20:12:55
阅读次数:
97
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-07-20 23:00:05
阅读次数:
85