上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: Description Farmer John正在一个新的销售区域对他的牛奶销售方案进行调查。他想把牛奶送到T个城镇 (1 <= T <= 25,000),编号为1T。这些城镇之间通过R条道路 (1 <= R <= 50,000,编号为1到R) 和P条航线 (1 <= P <= 50,000,编号为 阅读全文
posted @ 2019-04-08 21:46 进击的黑仔 阅读(283) 评论(0) 推荐(0)
摘要: 描述 后缀数组 (SA) 是一种重要的数据结构,通常使用倍增或者DC3算法实现,这超出了我们的讨论范围。在本题中,我们希望使用快排、Hash与二分实现一个简单的 O(n log^2⁡n ) 的后缀数组求法。详细地说,给定一个长度为 n 的字符串S(下标 0~n-1),我们可以用整数 k(0≤k<n) 阅读全文
posted @ 2019-04-04 10:45 进击的黑仔 阅读(350) 评论(0) 推荐(0)
摘要: 描述 很久很久以前,森林里住着一群兔子。有一天,兔子们想要研究自己的 DNA 序列。我们首先选取一个好长好长的 DNA 序列(小兔子是外星生物,DNA 序列可能包含 26 个小写英文字母),然后我们每次选择两个区间,询问如果用两个区间里的 DNA 序列分别生产出来两只兔子,这两个兔子是否一模一样。注 阅读全文
posted @ 2019-04-02 13:29 进击的黑仔 阅读(248) 评论(0) 推荐(0)
摘要: You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your program will read 阅读全文
posted @ 2019-04-02 03:13 进击的黑仔 阅读(164) 评论(0) 推荐(0)
摘要: 描述 给定一个长度为 n 的序列 A,A 中的数各不相同。对于 A 中的每一个数 A_i,求: min(1≤j<i) ⁡|A_i-A_j| 以及令上式取到最小值的 j(记为 P_i)。若最小值点不唯一,则选择使 A_j 较小的那个。 输入格式 第一行一个整数n,第二行n个数A_1~A_n。 输出格式 阅读全文
posted @ 2019-04-01 12:32 进击的黑仔 阅读(278) 评论(0) 推荐(0)
摘要: Description The left figure below shows a complete 3*3 grid made with 2*(3*4) (=24) matchsticks. The lengths of all matchsticks are one. You can find 阅读全文
posted @ 2019-03-31 21:33 进击的黑仔 阅读(448) 评论(0) 推荐(0)
摘要: 描述 输入一个长度为n的整数序列,从中找出一段不超过m的连续子序列,使得整个序列的和最大。 例如 1,-3,5,1,-2,3 当m=4时,S=5+1-2+3=7 当m=2或m=3时,S=5+1=6 输入格式 第一行两个数n,m(n,m<=300000) 第二行有n个数,要求在n个数找到最大子序和 输 阅读全文
posted @ 2019-03-31 20:15 进击的黑仔 阅读(218) 评论(0) 推荐(0)
摘要: Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though it o 阅读全文
posted @ 2019-03-31 18:38 进击的黑仔 阅读(297) 评论(0) 推荐(0)
摘要: Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have 阅读全文
posted @ 2019-03-31 17:26 进击的黑仔 阅读(163) 评论(0) 推荐(0)
摘要: Problem Description Sample Input 8 I 2 I -1 I 1 Q 3 L D R Q 2 8 I 2 I -1 I 1 Q 3 L D R Q 2 Sample Output 2 3 Hint The following diagram shows the stat 阅读全文
posted @ 2019-03-31 16:17 进击的黑仔 阅读(177) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页