题目描述
Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence"
if M <= m * p where M and m are the maximum and minimum numbers in the seq...
分类:
其他好文 时间:
2015-06-08 11:38:36
阅读次数:
105
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
分类:
其他好文 时间:
2015-06-08 00:54:18
阅读次数:
151
题意:找最长公共子序列(不要求连续)
分析:二维dp肯定的,不过我自己用的四层循环,超时;正解是画矩阵,找规律。以后要多注意这种思想
WA了很多遍,原因:1.对数组边界的处理;2.while(1)超时,改成while(cin>>a>>b)就过了
代码:
#include
#include
#define max(a,b) a>b?a:b
using namespace s...
分类:
其他好文 时间:
2015-06-07 15:50:06
阅读次数:
110
The determinant of a matrix 2?×?2 is defined as follows:
A matrix is called degenerate if its determinant is equal to zero.
The norm ||A|| of a matrix A is
defined as a maximum of absolute v...
分类:
其他好文 时间:
2015-06-07 13:52:04
阅读次数:
121
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from th...
分类:
其他好文 时间:
2015-06-07 12:28:40
阅读次数:
78
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 profit. You may complet...
分类:
编程语言 时间:
2015-06-06 22:05:00
阅读次数:
169
用maven打包写好的jar,在放到hive中作临时函数时报错。
错误信息如下:
hive> create temporary function maxvalue as "com.leaf.data.Maximum";
java.lang.SecurityException: Invalid signature file digest for Manifest main attribu...
分类:
其他好文 时间:
2015-06-06 16:38:31
阅读次数:
227
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ...
分类:
编程语言 时间:
2015-06-05 21:00:00
阅读次数:
128
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if yo...
分类:
其他好文 时间:
2015-06-05 15:48:10
阅读次数:
129
1 题目:Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longe...
分类:
其他好文 时间:
2015-06-05 15:31:51
阅读次数:
137