We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer arra ...
分类:
其他好文 时间:
2018-10-23 10:58:59
阅读次数:
157
Problem Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another ...
分类:
其他好文 时间:
2018-10-20 21:09:58
阅读次数:
139
题意 给定一个包含$n$个数的序列$a$,在其中任选若干个数,使得他们的和对$m$取模后最大。($n\leq 35$) 题解 显然,$2^n$的暴枚是不现实的...,于是我们想到了折半枚举,分成两部分暴枚,然后考虑合并,合并的时候用two pointers思想扫一遍就行了。 其实这是一道折半枚举+T ...
分类:
其他好文 时间:
2018-10-16 21:59:40
阅读次数:
237
一、最长公共子序列介绍 一个序列的子序列是在该序列中删去若干元素后得到的序列。例如:“ABCD”和“BDF”都是“ABCDEFG”的子序列。 最长公共子序列(Longest Common Subsequence,简写LCS)问题:给定两个序列X和Y,求X和Y长度最大的公共子序列。例如:X=“ABBC ...
分类:
其他好文 时间:
2018-10-09 18:11:30
阅读次数:
213
Equality CF 1038A A subsequence of string ss is a string that can be derived from ssby deleting some of its symbols without changing the order of the ...
分类:
其他好文 时间:
2018-10-06 11:55:26
阅读次数:
154
Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Input: [10,9,2,5,3,7,101,18] Output: 4 Explanation: T ...
分类:
其他好文 时间:
2018-10-05 23:28:00
阅读次数:
300
题目链接 Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, . ...
分类:
其他好文 时间:
2018-10-04 12:52:22
阅读次数:
130
Find a longest common subsequence of two strings. First and second line of each input case contain two strings of lowercase character a…z. There are n ...
分类:
其他好文 时间:
2018-10-02 17:24:56
阅读次数:
122
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). Example 1: 题目地址: Longest Continuous Incr ...
分类:
编程语言 时间:
2018-09-30 20:09:31
阅读次数:
174
Given a sequence of K integers { N?1??, N?2??, ..., N?K?? }. A continuous subsequence is defined to be { N?i??, N?i+1??, ..., N?j?? } where 1≤i≤j≤K. T ...
分类:
其他好文 时间:
2018-09-29 14:24:29
阅读次数:
146